1 |
61353
|
stefania.m
|
import { TestBed, waitForAsync } from '@angular/core/testing';
|
2 |
57592
|
stefania.m
|
import { RouterTestingModule } from '@angular/router/testing';
|
3 |
|
|
import { AppComponent } from './app.component';
|
4 |
|
|
|
5 |
|
|
describe('AppComponent', () => {
|
6 |
61353
|
stefania.m
|
beforeEach(waitForAsync(() => {
|
7 |
57592
|
stefania.m
|
TestBed.configureTestingModule({
|
8 |
|
|
imports: [
|
9 |
|
|
RouterTestingModule
|
10 |
|
|
],
|
11 |
|
|
declarations: [
|
12 |
|
|
AppComponent
|
13 |
|
|
],
|
14 |
|
|
}).compileComponents();
|
15 |
|
|
}));
|
16 |
|
|
|
17 |
|
|
it('should create the app', () => {
|
18 |
|
|
const fixture = TestBed.createComponent(AppComponent);
|
19 |
|
|
const app = fixture.debugElement.componentInstance;
|
20 |
|
|
expect(app).toBeTruthy();
|
21 |
|
|
});
|
22 |
|
|
|
23 |
|
|
it(`should have as title 'open-science-observatory-ui'`, () => {
|
24 |
|
|
const fixture = TestBed.createComponent(AppComponent);
|
25 |
|
|
const app = fixture.debugElement.componentInstance;
|
26 |
|
|
expect(app.title).toEqual('open-science-observatory-ui');
|
27 |
|
|
});
|
28 |
|
|
|
29 |
|
|
it('should render title in a h1 tag', () => {
|
30 |
|
|
const fixture = TestBed.createComponent(AppComponent);
|
31 |
|
|
fixture.detectChanges();
|
32 |
|
|
const compiled = fixture.debugElement.nativeElement;
|
33 |
|
|
expect(compiled.querySelector('h1').textContent).toContain('Welcome to open-science-observatory-ui!');
|
34 |
|
|
});
|
35 |
|
|
});
|