import { ComponentFixture, TestBed } from '@angular/core/testing'; import { HomeComponent } from './home.component'; import { TranslateModule } from '@ngx-translate/core'; import { provideRouter } from '@angular/router'; describe('HomeComponent', () => { let component: HomeComponent; let fixture: ComponentFixture; beforeEach(async () => { await TestBed.configureTestingModule({ declarations: [], imports: [HomeComponent, TranslateModule.forRoot()], providers: [provideRouter([])], }).compileComponents(); fixture = TestBed.createComponent(HomeComponent); component = fixture.componentInstance; fixture.detectChanges(); }); it('should create', () => { expect(component).toBeTruthy(); }); it('should render title in a h1 tag', () => { const compiled = fixture.debugElement.nativeElement; expect(compiled.querySelector('h1').textContent).toContain('PAGES.HOME.TITLE'); }); });