mirror of
https://github.com/discourse/discourse.git
synced 2025-03-22 06:25:39 +08:00
DEV: Fix pretender in poll tests (#17587)
This commit is contained in:
parent
e509c54b4c
commit
c700cf3213
@ -12,6 +12,7 @@ let requests = 0;
|
|||||||
module("Integration | Component | Widget | discourse-poll", function (hooks) {
|
module("Integration | Component | Widget | discourse-poll", function (hooks) {
|
||||||
setupRenderingTest(hooks);
|
setupRenderingTest(hooks);
|
||||||
|
|
||||||
|
hooks.beforeEach(function () {
|
||||||
pretender.put("/polls/vote", () => {
|
pretender.put("/polls/vote", () => {
|
||||||
++requests;
|
++requests;
|
||||||
return [
|
return [
|
||||||
@ -42,6 +43,7 @@ module("Integration | Component | Widget | discourse-poll", function (hooks) {
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
const template = hbs`
|
const template = hbs`
|
||||||
<MountWidget
|
<MountWidget
|
||||||
@ -160,13 +162,10 @@ module("Integration | Component | Widget | discourse-poll", function (hooks) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
await render(template);
|
await render(template);
|
||||||
|
|
||||||
assert.ok(exists(".poll-buttons .cast-votes[disabled=true]"));
|
assert.ok(exists(".poll-buttons .cast-votes[disabled=true]"));
|
||||||
|
|
||||||
await click("li[data-poll-option-id='1f972d1df351de3ce35a787c89faad29']");
|
await click("li[data-poll-option-id='1f972d1df351de3ce35a787c89faad29']");
|
||||||
|
|
||||||
await click(".poll-buttons .cast-votes");
|
await click(".poll-buttons .cast-votes");
|
||||||
|
|
||||||
assert.ok(exists(".chosen"));
|
assert.ok(exists(".chosen"));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user