diff --git a/lib/content-services/src/lib/tag/tags-creator/tags-creator.component.spec.ts b/lib/content-services/src/lib/tag/tags-creator/tags-creator.component.spec.ts index f6f9b1bb5b..4c524542df 100644 --- a/lib/content-services/src/lib/tag/tags-creator/tags-creator.component.spec.ts +++ b/lib/content-services/src/lib/tag/tags-creator/tags-creator.component.spec.ts @@ -396,6 +396,27 @@ describe('TagsCreatorComponent', () => { expect(error).toBe('TAG.TAGS_CREATOR.ERRORS.EXISTING_TAG'); })); + it('should show error when deleting other Tag1 and Tag2 is typed and already existing tag', fakeAsync(() => { + const tag1 = 'Some tag'; + const tag2 = 'Other tag'; + + addTagToAddedList(tag1, true, 0); + tick(); + + spyOn(tagService, 'findTagByName').and.returnValue(of({ + entry: { + tag: tag2, + id: 'tag-1' + } + })); + typeTag(tag2); + component.removeTag(tag1); + tick(); + fixture.detectChanges(); + const error = getFirstError(); + expect(error).toBe('TAG.TAGS_CREATOR.ERRORS.EXISTING_TAG'); + })); + it('should error for required when not typed anything and blur input', fakeAsync(() => { component.tagNameControlVisible = true; component.tagNameControl.markAsTouched(); diff --git a/lib/content-services/src/lib/tag/tags-creator/tags-creator.component.ts b/lib/content-services/src/lib/tag/tags-creator/tags-creator.component.ts index c93143741f..c08df6b568 100644 --- a/lib/content-services/src/lib/tag/tags-creator/tags-creator.component.ts +++ b/lib/content-services/src/lib/tag/tags-creator/tags-creator.component.ts @@ -270,6 +270,7 @@ export class TagsCreatorComponent implements OnInit, OnDestroy { this.removeTagFromArray(this.tags, tag); this.tagNameControl.updateValueAndValidity(); this.updateExistingTagsListOnRemoveFromTagsToConfirm(tag); + this.exactTagSet$.next(); this.checkScrollbarVisibility(); this.tagsChange.emit(this.tags); }