annotate src/app/app.component.spec.ts @ 349:bf038a51f7e3

Restore some of the feature related logic from waveform.component into a utilities module. Introduce some additional types for representing reshaped features. A work in progress.
author Lucas Thompson <dev@lucas.im>
date Thu, 25 May 2017 17:57:03 +0100
parents 53ea6406d601
children
rev   line source
dev@236 1 import { TestBed, async } from '@angular/core/testing';
angular-cli@0 2
angular-cli@0 3 import { AppComponent } from './app.component';
angular-cli@0 4
dev@236 5 describe('AppComponent', () => {
dev@236 6 beforeEach(async(() => {
angular-cli@0 7 TestBed.configureTestingModule({
angular-cli@0 8 declarations: [
angular-cli@0 9 AppComponent
angular-cli@0 10 ],
dev@236 11 }).compileComponents();
dev@236 12 }));
angular-cli@0 13
angular-cli@0 14 it('should create the app', async(() => {
dev@236 15 const fixture = TestBed.createComponent(AppComponent);
dev@236 16 const app = fixture.debugElement.componentInstance;
angular-cli@0 17 expect(app).toBeTruthy();
angular-cli@0 18 }));
angular-cli@0 19
angular-cli@0 20 it(`should have as title 'app works!'`, async(() => {
dev@236 21 const fixture = TestBed.createComponent(AppComponent);
dev@236 22 const app = fixture.debugElement.componentInstance;
angular-cli@0 23 expect(app.title).toEqual('app works!');
angular-cli@0 24 }));
angular-cli@0 25
angular-cli@0 26 it('should render title in a h1 tag', async(() => {
dev@236 27 const fixture = TestBed.createComponent(AppComponent);
angular-cli@0 28 fixture.detectChanges();
dev@236 29 const compiled = fixture.debugElement.nativeElement;
angular-cli@0 30 expect(compiled.querySelector('h1').textContent).toContain('app works!');
angular-cli@0 31 }));
angular-cli@0 32 });