File tree Expand file tree Collapse file tree 3 files changed +6
-15
lines changed Expand file tree Collapse file tree 3 files changed +6
-15
lines changed Original file line number Diff line number Diff line change @@ -7,8 +7,8 @@ describe('core-ui App', function() {
7
7
page = new CoreUIPage ( ) ;
8
8
} ) ;
9
9
10
- it ( 'should display message saying app works ' , ( ) => {
10
+ it ( 'should display footer containing creativeLabs ' , ( ) => {
11
11
page . navigateTo ( ) ;
12
- expect ( page . getParagraphText ( ) ) . toEqual ( 'app works! ') ;
12
+ expect ( page . getParagraphText ( ) ) . toContain ( 'creativeLabs ') ;
13
13
} ) ;
14
14
} ) ;
Original file line number Diff line number Diff line change 1
- import { browser , element , by } from 'protractor/globals ' ;
1
+ import { browser , element , by } from 'protractor' ;
2
2
3
3
export class CoreUIPage {
4
4
navigateTo ( ) {
5
5
return browser . get ( '/' ) ;
6
6
}
7
7
8
8
getParagraphText ( ) {
9
- return element ( by . css ( 'app-root h1 ') ) . getText ( ) ;
9
+ return element ( by . tagName ( 'footer ') ) . getText ( ) ;
10
10
}
11
11
}
Original file line number Diff line number Diff line change
1
+ import { RouterTestingModule } from '@angular/router/testing'
1
2
import { TestBed , async } from '@angular/core/testing' ;
2
3
import { AppComponent } from './app.component' ;
3
4
describe ( 'AppComponent' , ( ) => {
@@ -6,22 +7,12 @@ describe('AppComponent', () => {
6
7
declarations : [
7
8
AppComponent
8
9
] ,
10
+ imports : [ RouterTestingModule ]
9
11
} ) . compileComponents ( ) ;
10
12
} ) ) ;
11
13
it ( 'should create the app' , async ( ( ) => {
12
14
const fixture = TestBed . createComponent ( AppComponent ) ;
13
15
const app = fixture . debugElement . componentInstance ;
14
16
expect ( app ) . toBeTruthy ( ) ;
15
17
} ) ) ;
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
- } ) ) ;
27
18
} ) ;
You can’t perform that action at this time.
0 commit comments