/
githubmirror
/
angular
Обзор
Документация
Войти
/
githubmirror
/
angular
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
integration/platform-server-hydration/src/app/app.component.spec.ts
29 строк
889 B
Matthieu Riegler
refactor(core): remove `compileComponents` invocations (#61032)
09 май 2025, 20:27
09 май 2025, 20:27
3eeea56
Код
Авторство
О чём код?
import {TestBed} from '@angular/core/testing'; import {AppComponent} from './app.component'; describe('AppComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [AppComponent], }); }); it('should create the app', () => { const fixture = TestBed.createComponent(AppComponent); const app = fixture.componentInstance; expect(app).toBeTruthy(); }); it(`should have the 'hydration' title`, () => { const fixture = TestBed.createComponent(AppComponent); const app = fixture.componentInstance; expect(app.title).toEqual('hydration'); }); it('should render title', () => { const fixture = TestBed.createComponent(AppComponent); fixture.detectChanges(); const compiled = fixture.nativeElement as HTMLElement; expect(compiled.querySelector('h1')?.textContent).toContain('Hello, hydration'); }); });