import { ComponentFixture, TestBed } from '@angular/core/testing'; import { SidebarComponent } from './sidebar.component'; describe('SidebarComponent', () => { let component: SidebarComponent; let fixture: ComponentFixture; beforeEach(async () => { await TestBed.configureTestingModule({ imports: [SidebarComponent], }).compileComponents(); fixture = TestBed.createComponent(SidebarComponent); component = fixture.componentInstance; fixture.detectChanges(); }); it('should create', () => { expect(component).toBeTruthy(); }); it('should render title', () => { fixture.componentRef.setInput('title', 'Mayvio UI'); fixture.detectChanges(); const el: HTMLElement = fixture.nativeElement; expect(el.textContent).toContain('Mayvio UI'); }); it('should render links', () => { fixture.componentRef.setInput('links', [{ label: 'Dashboard', href: '/dashboard' }]); fixture.detectChanges(); const el: HTMLElement = fixture.nativeElement; expect(el.textContent).toContain('Dashboard'); }); });