From cea3a027f34eb445585617842ad9835d43047dc1 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Mon, 24 Jun 2019 10:45:30 +0200 Subject: [PATCH] FIX: category-chooser search should be scoped to category (#7794) --- .../javascripts/select-kit/components/category-chooser.js.es6 | 2 +- test/javascripts/components/category-chooser-test.js.es6 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/select-kit/components/category-chooser.js.es6 b/app/assets/javascripts/select-kit/components/category-chooser.js.es6 index 3df3e049c9f..a1d453aa2a8 100644 --- a/app/assets/javascripts/select-kit/components/category-chooser.js.es6 +++ b/app/assets/javascripts/select-kit/components/category-chooser.js.es6 @@ -30,7 +30,7 @@ export default ComboBoxComponent.extend({ } if (this.scopedCategoryId) { - computedContent = this.categoriesByScope().map(c => + computedContent = this.categoriesByScope(this.scopedCategoryId).map(c => this.computeContentItem(c) ); } diff --git a/test/javascripts/components/category-chooser-test.js.es6 b/test/javascripts/components/category-chooser-test.js.es6 index 70ecd7d4f0a..79cc252682a 100644 --- a/test/javascripts/components/category-chooser-test.js.es6 +++ b/test/javascripts/components/category-chooser-test.js.es6 @@ -45,9 +45,9 @@ componentTest("with scopedCategoryId", { assert.equal(this.subject.rowByIndex(1).value(), 26); assert.equal(this.subject.rows().length, 2); - await this.subject.fillInFilter("dev"); + await this.subject.fillInFilter("spec"); - assert.equal(this.subject.rows().length, 3); + assert.equal(this.subject.rows().length, 1); } });