FIX: select-box improvments

- more tests for category-select-box
- allows to clear selection
- fix positioning on safari
- focus on click
- do not display uncategorized if not allowed in settings
- fix component state impacting other specs
- better texts
- higher category-select-box on mobile
This commit is contained in:
Joffrey JAFFEUX
2017-08-28 14:34:04 +02:00
committed by GitHub
parent be972912cb
commit b83c0747d9
11 changed files with 166 additions and 76 deletions

View File

@ -313,3 +313,25 @@ componentTest('static headerText', {
});
}
});
componentTest('clearable selection', {
template: '{{select-box value=1 content=content clearable=true}}',
beforeEach() {
this.set("content", [{ id: 1, text: "robin" }, { id: 2, text: "regis" }]);
},
test(assert) {
click(".select-box-header");
andThen(() => {
assert.ok(exists(".select-box-row.is-highlighted"));
assert.equal(find(".select-box-header .current-selection").html().trim(), "robin");
});
click(".select-box-header .clear-selection");
andThen(() => {
assert.notOk(exists(".select-box-row.is-highlighted"));
assert.equal(find(".select-box-header .current-selection").html().trim(), "Select...");
});
}
});