Skip to content

Commit c708624

Browse files
Copilotrenemadsen
andcommitted
Add tests for icon preview functionality
Co-authored-by: renemadsen <[email protected]>
1 parent 5891509 commit c708624

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

eform-client/src/app/modules/advanced/modules/navigation-menu/components/menu-item/navigation-menu-item-edit/navigation-menu-item-edit.component.spec.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,25 @@ describe('NavigationMenuItemEditComponent', () => {
3434
it('should create', () => {
3535
expect(component).toBeTruthy();
3636
});
37+
38+
it('should display icon preview when icon is set', () => {
39+
component.item.icon = 'home';
40+
fixture.detectChanges();
41+
42+
const compiled = fixture.nativeElement;
43+
const iconPreview = compiled.querySelector('#editIconPreview');
44+
45+
expect(iconPreview).toBeTruthy();
46+
expect(iconPreview.textContent.trim()).toBe('home');
47+
});
48+
49+
it('should not display icon preview when icon is not set', () => {
50+
component.item.icon = '';
51+
fixture.detectChanges();
52+
53+
const compiled = fixture.nativeElement;
54+
const iconPreview = compiled.querySelector('#editIconPreview');
55+
56+
expect(iconPreview).toBeFalsy();
57+
});
3758
});

0 commit comments

Comments
 (0)