Skip to content

Commit 8a78375

Browse files
committed
tests: fix minimal testing
1 parent ddeb382 commit 8a78375

File tree

3 files changed

+6
-15
lines changed

3 files changed

+6
-15
lines changed

e2e/app.e2e-spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ describe('core-ui App', function() {
77
page = new CoreUIPage();
88
});
99

10-
it('should display message saying app works', () => {
10+
it('should display footer containing creativeLabs', () => {
1111
page.navigateTo();
12-
expect(page.getParagraphText()).toEqual('app works!');
12+
expect(page.getParagraphText()).toContain('creativeLabs');
1313
});
1414
});

e2e/app.po.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { browser, element, by } from 'protractor/globals';
1+
import { browser, element, by } from 'protractor';
22

33
export class CoreUIPage {
44
navigateTo() {
55
return browser.get('/');
66
}
77

88
getParagraphText() {
9-
return element(by.css('app-root h1')).getText();
9+
return element(by.tagName('footer')).getText();
1010
}
1111
}

src/app/app.component.spec.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { RouterTestingModule } from '@angular/router/testing'
12
import { TestBed, async } from '@angular/core/testing';
23
import { AppComponent } from './app.component';
34
describe('AppComponent', () => {
@@ -6,22 +7,12 @@ describe('AppComponent', () => {
67
declarations: [
78
AppComponent
89
],
10+
imports: [ RouterTestingModule ]
911
}).compileComponents();
1012
}));
1113
it('should create the app', async(() => {
1214
const fixture = TestBed.createComponent(AppComponent);
1315
const app = fixture.debugElement.componentInstance;
1416
expect(app).toBeTruthy();
1517
}));
16-
it(`should have as title 'app'`, async(() => {
17-
const fixture = TestBed.createComponent(AppComponent);
18-
const app = fixture.debugElement.componentInstance;
19-
expect(app.title).toEqual('app');
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 app!');
26-
}));
2718
});

0 commit comments

Comments
 (0)