FIX: category-chooser search should be scoped to category (#7794)

FIX: category-chooser search should be scoped to category (#7794)

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 3df3e04..a1d453a 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 70ecd7d..79cc252 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);
   }
 });

GitHub sha: cea3a027

1 Like