/
githubmirror
/
angular-cli
Обзор
Документация
Войти
/
githubmirror
/
angular-cli
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
tests/e2e/assets/ssr-project-webpack/src/app/app.component.spec.ts
33 строки
1 KB
Alan Agius
test: migrate legacy CLI tests to e2e directory
17 дек 2025, 19:36
17 дек 2025, 19:36
7d3e0ad
Код
Авторство
О чём код?
import { TestBed } from '@angular/core/testing'; import { RouterModule } from '@angular/router'; import { AppComponent } from './app.component'; describe('AppComponent', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [RouterModule.forRoot([])], declarations: [AppComponent], }), ); it('should create the app', () => { const fixture = TestBed.createComponent(AppComponent); const app = fixture.componentInstance; expect(app).toBeTruthy(); }); it(`should have as title '20-ssr-project-webpack'`, () => { const fixture = TestBed.createComponent(AppComponent); const app = fixture.componentInstance; expect(app.title).toEqual('20-ssr-project-webpack'); }); it('should render title', () => { const fixture = TestBed.createComponent(AppComponent); fixture.detectChanges(); const compiled = fixture.nativeElement as HTMLElement; expect(compiled.querySelector('.content span')?.textContent).toContain( '20-ssr-project-webpack app is running!', ); }); });