cic-staff-client/src/app/app.component.spec.ts

34 lines
1.2 KiB
TypeScript
Raw Normal View History

2020-10-30 16:16:05 +01:00
import { TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from '@app/app.component';
2021-05-10 18:15:25 +02:00
import { TransactionService } from '@app/_services';
import {
FooterStubComponent,
SidebarStubComponent,
TopbarStubComponent,
TransactionServiceStub,
} from '@src/testing';
2021-06-25 08:40:29 +02:00
import { HttpClientTestingModule } from '@angular/common/http/testing';
2020-10-30 16:16:05 +01:00
describe('AppComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [HttpClientTestingModule, RouterTestingModule],
2021-05-10 18:15:25 +02:00
declarations: [AppComponent, FooterStubComponent, SidebarStubComponent, TopbarStubComponent],
providers: [{ provide: TransactionService, useClass: TransactionServiceStub }],
2020-10-30 16:16:05 +01:00
}).compileComponents();
});
it('should create the app', () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app).toBeTruthy();
});
it(`should have as title 'cic-staff-client'`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app.title).toEqual('cic-staff-client');
});
});