mirror of
https://github.com/discourse/discourse.git
synced 2025-03-24 08:25:43 +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) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
hooks.beforeEach(function () {
|
||||
pretender.put("/polls/vote", () => {
|
||||
++requests;
|
||||
return [
|
||||
@ -42,6 +43,7 @@ module("Integration | Component | Widget | discourse-poll", function (hooks) {
|
||||
},
|
||||
];
|
||||
});
|
||||
});
|
||||
|
||||
const template = hbs`
|
||||
<MountWidget
|
||||
@ -160,13 +162,10 @@ module("Integration | Component | Widget | discourse-poll", function (hooks) {
|
||||
});
|
||||
|
||||
await render(template);
|
||||
|
||||
assert.ok(exists(".poll-buttons .cast-votes[disabled=true]"));
|
||||
|
||||
await click("li[data-poll-option-id='1f972d1df351de3ce35a787c89faad29']");
|
||||
|
||||
await click(".poll-buttons .cast-votes");
|
||||
|
||||
assert.ok(exists(".chosen"));
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user