mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
select-kit refactoring
* improve events naming/handling * do not explicitly check for true/Fasle * make sure header is re-computed on toggle
This commit is contained in:
parent
2509bef2c0
commit
3ec2024466
23 changed files with 140 additions and 153 deletions
|
@ -469,58 +469,6 @@ componentTest('with collection header', {
|
|||
}
|
||||
});
|
||||
|
||||
componentTest('with onToggle', {
|
||||
template: '{{single-select onToggle=onToggle}}',
|
||||
|
||||
beforeEach() {
|
||||
this.set("onToggle", () => $(".select-kit").append("<span class='onToggleTest'></span>"));
|
||||
},
|
||||
|
||||
test(assert) {
|
||||
andThen(() => assert.notOk(exists(".onToggleTest")));
|
||||
|
||||
this.get('subject').expand();
|
||||
|
||||
andThen(() => assert.ok(exists(".onToggleTest")));
|
||||
}
|
||||
});
|
||||
|
||||
componentTest('with onExpand', {
|
||||
template: '{{single-select onExpand=onExpand}}',
|
||||
|
||||
beforeEach() {
|
||||
this.set("onExpand", () => $(".select-kit").append("<span class='onExpandTest'></span>"));
|
||||
},
|
||||
|
||||
test(assert) {
|
||||
andThen(() => assert.notOk(exists(".onExpandTest")));
|
||||
|
||||
this.get('subject').expand();
|
||||
|
||||
andThen(() => assert.ok(exists(".onExpandTest")));
|
||||
}
|
||||
});
|
||||
|
||||
componentTest('with onCollapse', {
|
||||
template: '{{single-select onCollapse=onCollapse}}',
|
||||
|
||||
beforeEach() {
|
||||
this.set("onCollapse", () => $(".select-kit").append("<span class='onCollapseTest'></span>"));
|
||||
},
|
||||
|
||||
test(assert) {
|
||||
andThen(() => assert.notOk(exists(".onCollapseTest")));
|
||||
|
||||
this.get('subject').expand();
|
||||
|
||||
andThen(() => assert.notOk(exists(".onCollapseTest")));
|
||||
|
||||
this.get('subject').collapse();
|
||||
|
||||
andThen(() => assert.ok(exists(".onCollapseTest")));
|
||||
}
|
||||
});
|
||||
|
||||
componentTest('with title', {
|
||||
template: '{{single-select title=(i18n "test.title")}}',
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue