Skip to content

Commit

Permalink
[ACS-8749] View More tags button no longer shows when all tags are re…
Browse files Browse the repository at this point in the history
…moved from a node
  • Loading branch information
swapnil-verma-gl committed Sep 16, 2024
1 parent db56f03 commit 85f2897
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ describe('DynamicChipListComponent', () => {
element.style.maxWidth = '309px';
});

afterEach(() =>{
afterEach(() => {
fixture.destroy();
});

Expand Down Expand Up @@ -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();
}));
});
});

0 comments on commit 85f2897

Please sign in to comment.