Files
front/src/app/app.spec.ts
T
2026-10-07 12:10:12 +03:00

39 lines
1.3 KiB
TypeScript

import { provideHttpClient } from '@angular/common/http';
import { TestBed } from '@angular/core/testing';
import { provideRouter } from '@angular/router';
import { provideServiceWorker } from '@angular/service-worker';
import { provideEffects } from '@ngrx/effects';
import { provideState, provideStore } from '@ngrx/store';
import { App } from './app';
import { AuthEffects, GorodarEffects, gorodarFeature } from './state';
describe('App', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [App],
providers: [
provideHttpClient(),
provideRouter([]),
provideStore(),
provideState(gorodarFeature),
provideEffects(GorodarEffects, AuthEffects),
provideServiceWorker('ngsw-worker.js', { enabled: false }),
],
}).compileComponents();
});
it('should create the app', () => {
const fixture = TestBed.createComponent(App);
const app = fixture.componentInstance;
expect(app).toBeTruthy();
});
it('should render bottom navigation', () => {
const fixture = TestBed.createComponent(App);
fixture.detectChanges();
const compiled = fixture.nativeElement as HTMLElement;
expect(compiled.querySelector('app-bottom-nav')?.textContent).toContain('Города');
});
});