1 |
61424
|
stefania.m
|
import { TestBed, waitForAsync } from '@angular/core/testing';
|
2 |
54479
|
myrto.kouk
|
import { AppComponent } from './app.component';
|
3 |
|
|
describe('AppComponent', () => {
|
4 |
61424
|
stefania.m
|
beforeEach(waitForAsync(() => {
|
5 |
54479
|
myrto.kouk
|
TestBed.configureTestingModule({
|
6 |
|
|
declarations: [
|
7 |
|
|
AppComponent
|
8 |
|
|
],
|
9 |
|
|
}).compileComponents();
|
10 |
|
|
}));
|
11 |
61424
|
stefania.m
|
it('should create the app', waitForAsync(() => {
|
12 |
54479
|
myrto.kouk
|
const fixture = TestBed.createComponent(AppComponent);
|
13 |
|
|
const app = fixture.debugElement.componentInstance;
|
14 |
|
|
expect(app).toBeTruthy();
|
15 |
|
|
}));
|
16 |
61424
|
stefania.m
|
it(`should have as title 'app'`, waitForAsync(() => {
|
17 |
54479
|
myrto.kouk
|
const fixture = TestBed.createComponent(AppComponent);
|
18 |
|
|
const app = fixture.debugElement.componentInstance;
|
19 |
|
|
expect(app.title).toEqual('app');
|
20 |
|
|
}));
|
21 |
61424
|
stefania.m
|
it('should render title in a h1 tag', waitForAsync(() => {
|
22 |
54479
|
myrto.kouk
|
const fixture = TestBed.createComponent(AppComponent);
|
23 |
|
|
fixture.detectChanges();
|
24 |
|
|
const compiled = fixture.debugElement.nativeElement;
|
25 |
54830
|
myrto.kouk
|
expect(compiled.querySelector('h1').textContent).toContain('Welcome to uoa-repository-manager-ui!');
|
26 |
54479
|
myrto.kouk
|
}));
|
27 |
|
|
});
|