2
0
Fork 0
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:
Joffrey JAFFEUX 2018-01-11 09:39:51 +01:00 committed by GitHub
parent 2509bef2c0
commit 3ec2024466
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 140 additions and 153 deletions

View file

@ -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")}}',