DEV: prevents prop override and simplifies test (#17457)
This commit is contained in:
parent
a939609d32
commit
638bbf8f7e
|
@ -5,23 +5,6 @@ import { hbs } from "ember-cli-htmlbars";
|
||||||
import selectKit from "discourse/tests/helpers/select-kit-helper";
|
import selectKit from "discourse/tests/helpers/select-kit-helper";
|
||||||
import { paste, query } from "discourse/tests/helpers/qunit-helpers";
|
import { paste, query } from "discourse/tests/helpers/qunit-helpers";
|
||||||
|
|
||||||
const DEFAULT_CONTENT = [
|
|
||||||
{ id: 1, name: "foo" },
|
|
||||||
{ id: 2, name: "bar" },
|
|
||||||
{ id: 3, name: "baz" },
|
|
||||||
];
|
|
||||||
|
|
||||||
const setDefaultState = (ctx, options) => {
|
|
||||||
const properties = Object.assign(
|
|
||||||
{
|
|
||||||
content: DEFAULT_CONTENT,
|
|
||||||
value: null,
|
|
||||||
},
|
|
||||||
options || {}
|
|
||||||
);
|
|
||||||
ctx.setProperties(properties);
|
|
||||||
};
|
|
||||||
|
|
||||||
module(
|
module(
|
||||||
"Integration | Component | select-kit/email-group-user-chooser",
|
"Integration | Component | select-kit/email-group-user-chooser",
|
||||||
function (hooks) {
|
function (hooks) {
|
||||||
|
@ -32,15 +15,7 @@ module(
|
||||||
});
|
});
|
||||||
|
|
||||||
test("pasting", async function (assert) {
|
test("pasting", async function (assert) {
|
||||||
setDefaultState(this);
|
await render(hbs`<EmailGroupUserChooser/>`);
|
||||||
|
|
||||||
await render(hbs`
|
|
||||||
<EmailGroupUserChooser
|
|
||||||
@value={{this.value}}
|
|
||||||
@content={{this.content}}
|
|
||||||
@options={{hash maximum=2}}
|
|
||||||
/>
|
|
||||||
`);
|
|
||||||
|
|
||||||
await this.subject.expand();
|
await this.subject.expand();
|
||||||
await paste(query(".filter-input"), "foo,bar");
|
await paste(query(".filter-input"), "foo,bar");
|
||||||
|
|
Loading…
Reference in New Issue