File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
exercises/07-Very-Specific-Rules Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ describe("All the styles should be applied", ()=>{
52
52
backgroundColor = backgroundColor . toLowerCase ( )
53
53
}
54
54
55
- } expect ( background === 'green' || backgroundColor === 'green' ) . toBeTruthy ( ) ;
55
+ } expect ( ( background && background === 'green' ) || ( backgroundColor && backgroundColor === 'green' ) ) . toBeTruthy ( ) ;
56
56
} )
57
57
58
58
test ( "The odd rows of the table should have yellow background" , ( ) => {
@@ -64,13 +64,13 @@ describe("All the styles should be applied", ()=>{
64
64
let background = "" ;
65
65
let backgroundColor = "" ;
66
66
for ( let i = 0 ; i < cssArray . length ; i ++ ) {
67
- if ( cssArray [ i ] . selectorText === "tr:nth-child(odd)" ) {
67
+ if ( cssArray [ i ] . selectorText . includes ( "tr:nth-child(odd)" ) ) {
68
68
background = cssArray [ i ] . style [ 'background' ] ;
69
69
backgroundColor = cssArray [ i ] . style [ 'background-color' ] ;
70
70
71
71
}
72
72
73
- } expect ( background . toLowerCase ( ) === "yellow" || backgroundColor . toLowerCase ( ) === "yellow" ) . toBeTruthy ( ) ;
73
+ } expect ( ( background && background . toLowerCase ( ) === "yellow" ) || ( backgroundColor && backgroundColor . toLowerCase ( ) === "yellow" ) ) . toBeTruthy ( ) ;
74
74
} )
75
75
76
76
test ( "Write all your rules above the existing code" , ( ) => {
@@ -95,4 +95,4 @@ describe("All the styles should be applied", ()=>{
95
95
expect ( title ) . toBeTruthy ( )
96
96
} )
97
97
98
- } ) ;
98
+ } ) ;
You can’t perform that action at this time.
0 commit comments