@@ -6,6 +6,7 @@ describe('NgModule', function () {
66 const gold = 'rgba(255, 215, 0, 1)' ;
77 const powderblue = 'rgba(176, 224, 230, 1)' ;
88 const lightgray = 'rgba(211, 211, 211, 1)' ;
9+ const white = 'rgba(0, 0, 0, 0)' ;
910
1011 function getCommonsSectionStruct ( ) {
1112 const buttons = element . all ( by . css ( 'nav a' ) ) ;
@@ -55,7 +56,7 @@ describe('NgModule', function () {
5556 }
5657
5758 // tests
58- function appTitleTests ( color : string ) {
59+ function appTitleTests ( color : string , name ?: string ) {
5960 return function ( ) {
6061 it ( 'should have a gray header' , function ( ) {
6162 const commons = getCommonsSectionStruct ( ) ;
@@ -64,16 +65,16 @@ describe('NgModule', function () {
6465
6566 it ( 'should welcome us' , function ( ) {
6667 const commons = getCommonsSectionStruct ( ) ;
67- expect ( commons . subtitle . getText ( ) ) . toBe ( 'Welcome, Sam Spade' ) ;
68+ expect ( commons . subtitle . getText ( ) ) . toBe ( 'Welcome, ' + ( name || 'Sherlock Holmes' ) ) ;
6869 } ) ;
6970 } ;
7071 }
7172
72- function contactTests ( color : string ) {
73+ function contactTests ( color : string , name ?: string ) {
7374 return function ( ) {
7475 it ( 'shows the contact\'s owner' , function ( ) {
7576 const contacts = getContactSectionStruct ( ) ;
76- expect ( contacts . header . getText ( ) ) . toBe ( 'Contact of Sam Spade' ) ;
77+ expect ( contacts . header . getText ( ) ) . toBe ( 'Contact of ' + ( name || 'Sherlock Holmes' ) ) ;
7778 } ) ;
7879
7980 it ( 'can cycle between contacts' , function ( ) {
@@ -114,9 +115,9 @@ describe('NgModule', function () {
114115 browser . get ( '' ) ;
115116 } ) ;
116117
117- describe ( 'app-title' , appTitleTests ( lightgray ) ) ;
118+ describe ( 'app-title' , appTitleTests ( white , 'Miss Marple' ) ) ;
118119
119- describe ( 'contact' , contactTests ( lightgray ) ) ;
120+ describe ( 'contact' , contactTests ( lightgray , 'Miss Marple' ) ) ;
120121
121122 describe ( 'crisis center' , function ( ) {
122123 beforeEach ( function ( ) {
@@ -149,7 +150,7 @@ describe('NgModule', function () {
149150
150151 it ( 'shows a list of heroes' , function ( ) {
151152 const heroes = getHeroesSectionStruct ( ) ;
152- expect ( heroes . header . getText ( ) ) . toBe ( 'Heroes of Sam Spade ' ) ;
153+ expect ( heroes . header . getText ( ) ) . toBe ( 'Heroes of Miss Marple ' ) ;
153154 expect ( heroes . title . getText ( ) ) . toBe ( 'Hero List' ) ;
154155 expect ( heroes . items . count ( ) ) . toBe ( 6 ) ;
155156 expect ( heroes . items . get ( 0 ) . getText ( ) ) . toBe ( '11 - Mr. Nice' ) ;
0 commit comments