@@ -28,21 +28,25 @@ describe('Router', function () {
28
28
29
29
adminHref : hrefEles . get ( 2 ) ,
30
30
adminPreloadList : element . all ( by . css ( 'my-app > ng-component > ng-component > ul > li' ) ) ,
31
+
31
32
loginHref : hrefEles . get ( 3 ) ,
32
33
loginButton : element . all ( by . css ( 'my-app > ng-component > p > button' ) ) ,
33
-
34
- sidekicksButton : element . all ( by . css ( 'my-app > ng-component > button' ) ) ,
35
-
34
+
35
+ contactHref : hrefEles . get ( 4 ) ,
36
+ contactCancelButton : element . all ( by . buttonText ( 'Cancel' ) ) ,
37
+
38
+ outletComponents : element . all ( by . css ( 'my-app > ng-component' ) )
36
39
} ;
37
40
}
38
41
39
42
it ( 'should be able to see the start screen' , function ( ) {
40
43
let page = getPageStruct ( ) ;
41
- expect ( page . hrefs . count ( ) ) . toEqual ( 4 , 'should be 4 dashboard choices' ) ;
44
+ expect ( page . hrefs . count ( ) ) . toEqual ( 5 , 'should be 5 dashboard choices' ) ;
42
45
expect ( page . crisisHref . getText ( ) ) . toEqual ( 'Crisis Center' ) ;
43
46
expect ( page . heroesHref . getText ( ) ) . toEqual ( 'Heroes' ) ;
44
47
expect ( page . adminHref . getText ( ) ) . toEqual ( 'Admin' ) ;
45
48
expect ( page . loginHref . getText ( ) ) . toEqual ( 'Login' ) ;
49
+ expect ( page . contactHref . getText ( ) ) . toEqual ( 'Contact' ) ;
46
50
} ) ;
47
51
48
52
it ( 'should be able to see crises center items' , function ( ) {
@@ -120,12 +124,12 @@ describe('Router', function () {
120
124
} ) ;
121
125
} ) ;
122
126
123
- it ( 'should be able to handle 404 pages ' , function ( ) {
127
+ it ( 'should be able to see the secondary route ' , function ( ) {
124
128
let page = getPageStruct ( ) ;
125
129
page . heroesHref . click ( ) . then ( function ( ) {
126
- return page . sidekicksButton . click ( ) ;
130
+ return page . contactHref . click ( ) ;
127
131
} ) . then ( function ( ) {
128
- expect ( page . routerTitle . getText ( ) ) . toContain ( 'Page Not Found ') ;
132
+ expect ( page . outletComponents . count ( ) ) . toBe ( 2 , 'should be 2 displayed routes ') ;
129
133
} ) ;
130
134
} ) ;
131
135
0 commit comments