FIX: Toggling categories was requiring two clicks (#134)
This commit is contained in:
parent
d4ecda50ff
commit
c2f27d1e3b
|
@ -292,7 +292,7 @@ export default Controller.extend({
|
||||||
@action
|
@action
|
||||||
updateSelectedCategories(category) {
|
updateSelectedCategories(category) {
|
||||||
const filterCategories =
|
const filterCategories =
|
||||||
category.id === this.filterCategories ? null : category.id;
|
category.id === parseInt(this.filterCategories, 10) ? null : category.id;
|
||||||
this.setProperties({
|
this.setProperties({
|
||||||
filterCategories,
|
filterCategories,
|
||||||
selectedTopic: null,
|
selectedTopic: null,
|
||||||
|
|
|
@ -63,6 +63,13 @@ acceptance("Docs", function (needs) {
|
||||||
|
|
||||||
await click(".docs-item.docs-category");
|
await click(".docs-item.docs-category");
|
||||||
assert.equal(count(".docs-category.selected"), 1);
|
assert.equal(count(".docs-category.selected"), 1);
|
||||||
|
|
||||||
|
await click(".docs-item.docs-category");
|
||||||
|
assert.equal(
|
||||||
|
count(".docs-category.selected"),
|
||||||
|
0,
|
||||||
|
"clicking again deselects"
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue