mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 19:29:34 +08:00
cleaner title attribute for select-box
This commit is contained in:
23
test/javascripts/components/dropdown-select-box-test.js.es6
Normal file
23
test/javascripts/components/dropdown-select-box-test.js.es6
Normal file
@ -0,0 +1,23 @@
|
||||
import componentTest from 'helpers/component-test';
|
||||
|
||||
moduleForComponent('dropdown-select-box', { integration: true });
|
||||
|
||||
componentTest('the header has a title', {
|
||||
template: '{{dropdown-select-box content=content value=value}}',
|
||||
|
||||
beforeEach() {
|
||||
this.set("value", 1);
|
||||
this.set("content", [{ id: 1, text: "apple" }, { id: 2, text: "peach" }]);
|
||||
},
|
||||
|
||||
test(assert) {
|
||||
andThen(() => {
|
||||
assert.equal(find(".select-box-header .btn").attr("title"), "apple", "it has the correct title");
|
||||
});
|
||||
|
||||
andThen(() => {
|
||||
this.set("value", 2);
|
||||
assert.equal(find(".select-box-header .btn").attr("title"), "peach", "it correctly changes the title");
|
||||
});
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user