You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

app.component.spec.ts 1007B

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