39 lines
1.3 KiB
TypeScript
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('Города');
|
|
});
|
|
});
|