FIX: Show tag count for existing tags (#9892)

* FIX: Show tag count for existing tags

* Add test
This commit is contained in:
Bianca Nenciu 2020-06-11 14:13:48 +03:00 committed by GitHub
parent 45c399f0d7
commit dd85d44dda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 2 deletions

View File

@ -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";
}

View File

@ -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");