@@ -9,9 +9,7 @@ describe("All the styles should be applied", function () {
9
9
beforeEach ( ( ) => {
10
10
//here I import the HTML into the document
11
11
document . documentElement . innerHTML = html . toString ( ) ;
12
-
13
12
//apply the styles from the stylesheet if needed
14
-
15
13
} ) ;
16
14
afterEach ( ( ) => {
17
15
jest . resetModules ( ) ;
@@ -23,18 +21,13 @@ describe("All the styles should be applied", function () {
23
21
"head"
24
22
) . innerHTML = `<style>${ css . toString ( ) } </style>` ;
25
23
let cssArray = document . styleSheets [ 0 ] . cssRules ;
26
-
27
24
let orangeHoverSelector = "" ;
28
25
for ( let i = 0 ; i < cssArray . length ; i ++ ) {
29
-
30
- if ( cssArray [ i ] . selectorText === "ul li" | cssArray [ i ] . selectorText === "ul > li" ) {
26
+ if ( cssArray [ i ] . selectorText === "ul li" || cssArray [ i ] . selectorText === "ul > li" ) {
31
27
orangeHoverSelector = cssArray [ i ] . style . color ;
32
-
33
28
}
34
29
expect ( orangeHoverSelector ) . toBe ( "red" ) ;
35
30
}
36
-
37
-
38
31
} ) ;
39
32
it ( "The ul second element background should be green" , function ( ) {
40
33
document . querySelector (
@@ -44,7 +37,7 @@ describe("All the styles should be applied", function () {
44
37
45
38
let orangeHoverSelector = "" ;
46
39
for ( let i = 0 ; i < cssArray . length ; i ++ ) {
47
- if ( cssArray [ i ] . selectorText === "ol li:nth-child(2)" | cssArray [ i ] . selectorText === "ol > li:nth-child(2)" ) {
40
+ if ( cssArray [ i ] . selectorText === "ol li:nth-child(2)" || cssArray [ i ] . selectorText === "ol > li:nth-child(2)" ) {
48
41
orangeHoverSelector = cssArray [ i ] . style [ 'background-color' ] ;
49
42
50
43
}
@@ -90,9 +83,4 @@ describe("All the styles should be applied", function () {
90
83
let title = head . querySelector ( 'title' )
91
84
expect ( title ) . not . toBe ( null )
92
85
} )
93
-
94
-
95
-
96
-
97
-
98
86
} ) ;
0 commit comments