From dd85d44dda2d8017e693eb286d036a26fd0e07d8 Mon Sep 17 00:00:00 2001 From: Bianca Nenciu Date: Thu, 11 Jun 2020 14:13:48 +0300 Subject: [PATCH] FIX: Show tag count for existing tags (#9892) * FIX: Show tag count for existing tags * Add test --- .../addon/components/mini-tag-chooser.js | 2 +- .../select-kit/mini-tag-chooser-test.js | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/select-kit/addon/components/mini-tag-chooser.js b/app/assets/javascripts/select-kit/addon/components/mini-tag-chooser.js index 5c7035a0229..4ec0997537f 100644 --- a/app/assets/javascripts/select-kit/addon/components/mini-tag-chooser.js +++ b/app/assets/javascripts/select-kit/addon/components/mini-tag-chooser.js @@ -45,7 +45,7 @@ export default ComboBox.extend(TagsMixin, { }, modifyComponentForRow(collection, item) { - if (this.getValue(item) === this.selectKit.filter) { + if (this.getValue(item) === this.selectKit.filter && !item.count) { return "select-kit/select-kit-row"; } diff --git a/test/javascripts/components/select-kit/mini-tag-chooser-test.js b/test/javascripts/components/select-kit/mini-tag-chooser-test.js index 76265e7f837..c17b01bd6ad 100644 --- a/test/javascripts/components/select-kit/mini-tag-chooser-test.js +++ b/test/javascripts/components/select-kit/mini-tag-chooser-test.js @@ -31,7 +31,20 @@ componentTest("create a tag", { assert.equal(this.subject.header().value(), "foo,bar"); await this.subject.expand(); - await this.subject.fillInFilter("monkey"); + await this.subject.fillInFilter("mon"); + assert.equal( + find(".select-kit-row") + .text() + .trim(), + "monkey x1" + ); + await this.subject.fillInFilter("key"); + assert.equal( + find(".select-kit-row") + .text() + .trim(), + "monkey x1" + ); await this.subject.keyboard("enter"); assert.equal(this.subject.header().value(), "foo,bar,monkey");