mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACS-6585] - [ACC] Removing a to be created tag, while the create tag input field has a 'Tag already exists' error, removes the error (#9338)
This commit is contained in:
@@ -396,6 +396,27 @@ describe('TagsCreatorComponent', () => {
|
|||||||
expect(error).toBe('TAG.TAGS_CREATOR.ERRORS.EXISTING_TAG');
|
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(() => {
|
it('should error for required when not typed anything and blur input', fakeAsync(() => {
|
||||||
component.tagNameControlVisible = true;
|
component.tagNameControlVisible = true;
|
||||||
component.tagNameControl.markAsTouched();
|
component.tagNameControl.markAsTouched();
|
||||||
|
@@ -270,6 +270,7 @@ export class TagsCreatorComponent implements OnInit, OnDestroy {
|
|||||||
this.removeTagFromArray(this.tags, tag);
|
this.removeTagFromArray(this.tags, tag);
|
||||||
this.tagNameControl.updateValueAndValidity();
|
this.tagNameControl.updateValueAndValidity();
|
||||||
this.updateExistingTagsListOnRemoveFromTagsToConfirm(tag);
|
this.updateExistingTagsListOnRemoveFromTagsToConfirm(tag);
|
||||||
|
this.exactTagSet$.next();
|
||||||
this.checkScrollbarVisibility();
|
this.checkScrollbarVisibility();
|
||||||
this.tagsChange.emit(this.tags);
|
this.tagsChange.emit(this.tags);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user