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
@@ -0,0 +1,26 @@
import { acceptance } from "helpers/qunit-helpers";
acceptance("CategorySelectBox", {
loggedIn: true,
settings: {
allow_uncategorized_topics: false
}
});
QUnit.test("does not display uncategorized if not allowed", assert => {
visit("/");
click('#create-topic');
click(".category-select-box .select-box-header");
andThen(() => {
assert.ok(!exists('.category-select-box .select-box-row[title="uncategorized"]'));
});
});
QUnit.test("prefill category when category_id is set", assert => {
visit("/new-topic?category_id=1");
andThen(() => {
assert.equal(find('.category-select-box .current-selection').html().trim(), "bug");
});
});