[ACS-8749] View More tags button no longer shows when all tags are removed from a node (#10285)

This commit is contained in:
swapnil-verma-gl 2024-10-07 15:16:01 +05:30 committed by VitoAlbano
parent a963de5870
commit 5f7645b9f9
2 changed files with 12 additions and 2 deletions

View File

@ -26,7 +26,7 @@
<button
data-automation-id="adf-dynamic-chip-list-view-more-button"
mat-button
[hidden]="!limitChipsDisplayed"
[hidden]="chipsToDisplay.length === 0 || !limitChipsDisplayed"
[style.left.px]="viewMoreButtonLeftOffset"
[style.top.px]="viewMoreButtonTop"
class="adf-dynamic-chip-list-view-more-button"

View File

@ -182,7 +182,7 @@ describe('DynamicChipListComponent', () => {
element.style.maxWidth = '309px';
});
afterEach(() =>{
afterEach(() => {
fixture.destroy();
});
@ -317,5 +317,15 @@ describe('DynamicChipListComponent', () => {
fixture.detectChanges();
expect(viewMoreButton.hidden).toBeTrue();
}));
it('should not render View more button if there are no chips', fakeAsync(() => {
renderChips();
component.chips = [];
tick();
fixture.detectChanges();
expect(component.chipsToDisplay).toEqual([]);
expect(findViewMoreButton().hidden).toBeTrue();
}));
});
});