Guest User

Untitled

a guest
Jan 22nd, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. import {async, TestBed} from '@angular/core/testing';
  2.  
  3. import {AppComponent} from './app.component';
  4.  
  5. describe('AppComponent', () => {
  6. beforeEach(async(() => {
  7. TestBed
  8. .configureTestingModule({
  9. declarations: [AppComponent],
  10. })
  11. .compileComponents();
  12. }));
  13. it('should create the app', async(() => {
  14. const fixture = TestBed.createComponent(AppComponent);
  15. const app = fixture.debugElement.componentInstance;
  16. expect(app).toBeTruthy();
  17. }));
  18. it(`should have as title 'app'`, async(() => {
  19. const fixture = TestBed.createComponent(AppComponent);
  20. const app = fixture.debugElement.componentInstance;
  21. expect(app.title).toEqual('app');
  22. }));
  23. it('should render title in a h1 tag', async(() => {
  24. const fixture = TestBed.createComponent(AppComponent);
  25. fixture.detectChanges();
  26. const compiled = fixture.debugElement.nativeElement;
  27. expect(compiled.querySelector('h1').textContent)
  28. .toContain('Welcome to app!');
  29. }));
  30. });
Add Comment
Please, Sign In to add comment