@@ -35,14 +35,16 @@ describe("All the styles should be applied", ()=>{
3535 ) . innerHTML = `<style>${ css . toString ( ) } </style>` ;
3636 let cssArray = document . styleSheets [ 0 ] . cssRules ;
3737
38- let orangeHoverSelector = "" ;
38+ let background = "" ;
39+ let backgroundColor = "" ;
3940 for ( let i = 0 ; i < cssArray . length ; i ++ ) {
4041 if ( cssArray [ i ] . selectorText === "ol li:nth-child(2)" || cssArray [ i ] . selectorText === "ol > li:nth-child(2)" ) {
41- orangeHoverSelector = cssArray [ i ] . style [ 'background-color' ] ;
42+ background = cssArray [ i ] . style [ 'background' ] ;
43+ backgroundColor = cssArray [ i ] . style [ 'background-color' ] ;
4244
4345 }
4446
45- } expect ( orangeHoverSelector ) . toBe ( "green" ) ;
47+ } expect ( background === 'green' || backgroundColor === 'green' ) . toBeTruthy ( ) ;
4648 } )
4749
4850 test ( "The odd rows of the table should have yellow background" , ( ) => {
@@ -51,14 +53,16 @@ describe("All the styles should be applied", ()=>{
5153 ) . innerHTML = `<style>${ css . toString ( ) } </style>` ;
5254 let cssArray = document . styleSheets [ 0 ] . cssRules ;
5355
54- let orangeHoverSelector = "" ;
56+ let background = "" ;
57+ let backgroundColor = "" ;
5558 for ( let i = 0 ; i < cssArray . length ; i ++ ) {
5659 if ( cssArray [ i ] . selectorText === "tr:nth-child(odd)" ) {
57- orangeHoverSelector = cssArray [ i ] . style [ 'background' ] ;
58-
60+ background = cssArray [ i ] . style [ 'background' ] ;
61+ backgroundColor = cssArray [ i ] . style [ 'background-color' ] ;
62+
5963 }
6064
61- } expect ( orangeHoverSelector ) . toBe ( "yellow" ) ;
65+ } expect ( background === "yellow" || backgroundColor === "yellow" ) . toBeTruthy ( ) ;
6266 } )
6367
6468 test ( "Write all your rules above the existing code" , ( ) => {
0 commit comments