discourse/test/javascripts/components/select-kit/user-chooser-test.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
708 B
JavaScript
Raw Normal View History

2020-02-11 09:54:56 -05:00
import componentTest from "helpers/component-test";
import { testSelectKitModule } from "helpers/select-kit-helper";
2020-02-11 09:54:56 -05:00
testSelectKitModule("user-chooser");
function template() {
return `{{user-chooser value=value}}`;
}
componentTest("displays usernames", {
template: template(),
beforeEach() {
this.set("value", ["bob", "martin"]);
},
async test(assert) {
assert.equal(this.subject.header().name(), "bob,martin");
}
});
componentTest("can remove a username", {
template: template(),
beforeEach() {
this.set("value", ["bob", "martin"]);
},
async test(assert) {
await this.subject.deselectItem("bob");
assert.equal(this.subject.header().name(), "martin");
}
});