Files
Okupa_mi_coche_-_Angular/src/app/app.component.spec.ts
2021-01-20 12:53:46 +01:00

29 lines
887 B
TypeScript

import { TestBed, async, waitForAsync } from '@angular/core/testing';
import { AppComponent } from './app.component';
import { AppModule } from './app.module';
describe('AppComponent', () => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [AppModule]
}).compileComponents();
}));
it('should create the app', waitForAsync(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
}));
it('should render link to flight in a a tag', waitForAsync(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
console.log(compiled);
expect(compiled.querySelectorAll(' li a')[2].textContent).toContain(
'Book a Flight'
);
}));
});