DEV: Fix `setting-on-hash` deprecation (#23506)
``` deprecate-shim.js:33 DEPRECATION: You set the 'hasSavedVote' property on a {{hash}} object. Setting properties on objects generated by {{hash}} is deprecated. Please update to use an object created with a tracked property or getter, or with a custom helper. [deprecation id: setting-on-hash] ```
This commit is contained in:
parent
f27800ff88
commit
992737e592
|
@ -46,21 +46,10 @@ module("Integration | Component | Widget | discourse-poll", function (hooks) {
|
|||
});
|
||||
});
|
||||
|
||||
const template = hbs`
|
||||
<MountWidget
|
||||
@widget="discourse-poll"
|
||||
@args={{hash
|
||||
id=this.id
|
||||
post=this.post
|
||||
poll=this.poll
|
||||
vote=this.vote
|
||||
groupableUserFields=this.groupableUserFields
|
||||
}}
|
||||
/>
|
||||
`;
|
||||
|
||||
test("can vote", async function (assert) {
|
||||
this.setProperties({
|
||||
this.set(
|
||||
"args",
|
||||
EmberObject.create({
|
||||
post: EmberObject.create({
|
||||
id: 42,
|
||||
topic: {
|
||||
|
@ -81,9 +70,12 @@ module("Integration | Component | Widget | discourse-poll", function (hooks) {
|
|||
}),
|
||||
vote: [],
|
||||
groupableUserFields: [],
|
||||
});
|
||||
})
|
||||
);
|
||||
|
||||
await render(template);
|
||||
await render(
|
||||
hbs`<MountWidget @widget="discourse-poll" @args={{this.args}} />`
|
||||
);
|
||||
|
||||
requests = 0;
|
||||
|
||||
|
@ -103,7 +95,9 @@ module("Integration | Component | Widget | discourse-poll", function (hooks) {
|
|||
});
|
||||
|
||||
test("cannot vote if not member of the right group", async function (assert) {
|
||||
this.setProperties({
|
||||
this.set(
|
||||
"args",
|
||||
EmberObject.create({
|
||||
post: EmberObject.create({
|
||||
id: 42,
|
||||
topic: {
|
||||
|
@ -125,9 +119,12 @@ module("Integration | Component | Widget | discourse-poll", function (hooks) {
|
|||
}),
|
||||
vote: [],
|
||||
groupableUserFields: [],
|
||||
});
|
||||
})
|
||||
);
|
||||
|
||||
await render(template);
|
||||
await render(
|
||||
hbs`<MountWidget @widget="discourse-poll" @args={{this.args}} />`
|
||||
);
|
||||
|
||||
requests = 0;
|
||||
|
||||
|
@ -141,7 +138,9 @@ module("Integration | Component | Widget | discourse-poll", function (hooks) {
|
|||
});
|
||||
|
||||
test("voting on a multiple poll with no min attribute", async function (assert) {
|
||||
this.setProperties({
|
||||
this.set(
|
||||
"args",
|
||||
EmberObject.create({
|
||||
post: EmberObject.create({
|
||||
id: 42,
|
||||
topic: {
|
||||
|
@ -163,9 +162,12 @@ module("Integration | Component | Widget | discourse-poll", function (hooks) {
|
|||
}),
|
||||
vote: [],
|
||||
groupableUserFields: [],
|
||||
});
|
||||
})
|
||||
);
|
||||
|
||||
await render(template);
|
||||
await render(
|
||||
hbs`<MountWidget @widget="discourse-poll" @args={{this.args}} />`
|
||||
);
|
||||
assert.ok(exists(".poll-buttons .cast-votes[disabled=true]"));
|
||||
|
||||
await click("li[data-poll-option-id='1f972d1df351de3ce35a787c89faad29']");
|
||||
|
|
Loading…
Reference in New Issue