diff --git a/components/dropdown/nz-dropdown.spec.ts b/components/dropdown/nz-dropdown.spec.ts index d8b4acb5d7d..e85604acfea 100644 --- a/components/dropdown/nz-dropdown.spec.ts +++ b/components/dropdown/nz-dropdown.spec.ts @@ -133,6 +133,14 @@ describe('dropdown', () => { expect(items[ 0 ].classList.contains('ant-dropdown-menu-item')).toBe(true); expect(items[ 0 ].classList.contains('ant-dropdown-menu-item-selected')).toBe(false); }); + it('should append the correct className', () => { + testComponent.visible = true; + testComponent.itemSelected = true; + fixture.detectChanges(); + const items = overlayContainerElement.querySelectorAll('.ant-dropdown-menu-item') as NodeListOf; + expect(items[ 0 ].classList.contains('.ant-menu-item-selected')).toBe(false); + expect(items[ 0 ].classList.contains('ant-dropdown-menu-item-selected')).toBe(true); + }); it('should backdrop work with click', () => { testComponent.trigger = 'click'; fixture.detectChanges(); @@ -390,7 +398,7 @@ describe('dropdown', () => { Hover me