Skip to content

Commit 8338be7

Browse files
Merge pull request 4GeeksAcademy#125 from UmiKami/07-Very-Specific-Rules
fixed conditioonals in test to allow more possible solutions and be m…
2 parents 8b591f6 + 5aa8916 commit 8338be7

File tree

1 file changed

+4
-4
lines changed
  • exercises/07-Very-Specific-Rules

1 file changed

+4
-4
lines changed

exercises/07-Very-Specific-Rules/tests.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ describe("All the styles should be applied", ()=>{
5252
backgroundColor = backgroundColor.toLowerCase()
5353
}
5454

55-
} expect(background === 'green' || backgroundColor === 'green').toBeTruthy();
55+
} expect((background && background === 'green') || (backgroundColor && backgroundColor === 'green')).toBeTruthy();
5656
})
5757

5858
test("The odd rows of the table should have yellow background", ()=>{
@@ -64,13 +64,13 @@ describe("All the styles should be applied", ()=>{
6464
let background = "";
6565
let backgroundColor = "";
6666
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)")) {
6868
background = cssArray[i].style['background'];
6969
backgroundColor = cssArray[i].style['background-color'];
7070

7171
}
7272

73-
} expect(background.toLowerCase() === "yellow" || backgroundColor.toLowerCase() === "yellow").toBeTruthy();
73+
} expect((background && background.toLowerCase() === "yellow") || (backgroundColor && backgroundColor.toLowerCase() === "yellow")).toBeTruthy();
7474
})
7575

7676
test("Write all your rules above the existing code", ()=>{
@@ -95,4 +95,4 @@ describe("All the styles should be applied", ()=>{
9595
expect(title).toBeTruthy()
9696
})
9797

98-
});
98+
});

0 commit comments

Comments
 (0)