diff --git a/projects/components/src/menu-dropdown/menu-dropdown.component.test.ts b/projects/components/src/menu-dropdown/menu-dropdown.component.test.ts index bef150898..a2f18e1d8 100644 --- a/projects/components/src/menu-dropdown/menu-dropdown.component.test.ts +++ b/projects/components/src/menu-dropdown/menu-dropdown.component.test.ts @@ -26,9 +26,7 @@ describe('Menu dropdown Component', () => { test('should display trigger content as expected', () => { spectator = createHost( - ` - - ` + `` ); expect(spectator.query('.trigger-content')).toExist(); @@ -78,4 +76,10 @@ describe('Menu dropdown Component', () => { expect(onClickSpy).not.toHaveBeenCalled(); }); + + test('should not show the dropdown if no items to show.', () => { + spectator = createHost(``); + + expect(spectator.query('ht-popover-trigger')).not.toExist(); + }); }); diff --git a/projects/components/src/menu-dropdown/menu-dropdown.component.ts b/projects/components/src/menu-dropdown/menu-dropdown.component.ts index b9177f8bb..04bba2b34 100644 --- a/projects/components/src/menu-dropdown/menu-dropdown.component.ts +++ b/projects/components/src/menu-dropdown/menu-dropdown.component.ts @@ -9,7 +9,7 @@ import { MenuItemComponent } from './menu-item/menu-item.component'; changeDetection: ChangeDetectionStrategy.OnPush, template: ` - +