Skip to content

Commit 736bb07

Browse files
committed
change last part of the test.js to acept everithing that ends with #thirditem
1 parent baefe36 commit 736bb07

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

exercises/05-Specificity/styles.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ li + #thirditem {
66
background: yellow;
77
}
88
/**** DO NOT EDIT ANYTHING ABOVE THIS LINE ****/
9+

exercises/05-Specificity/tests.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ describe("All the styles should be applied", function () {
4343
let cssArray = document.styleSheets[0].cssRules;
4444
let orangeHoverSelector = "";
4545
for (let i = 0; i < cssArray.length; i++) {
46-
if (cssArray[i].selectorText === "#thirditem" && cssArray[i].style._importants.background === "important" || cssArray[i].style._importants["background-color"] === "important") {
46+
// here is the problem, the only selector acepted is #thirditem so if you read li + #thirditem or li #thirditem or li + #thirditem is not acepted
47+
if (cssArray[i].selectorText.endsWith("#thirditem") && cssArray[i].style._importants.background === "important" || cssArray[i].style._importants["background-color"] === "important") {
4748
orangeHoverSelector = cssArray[i].style.background || cssArray[i].style["background-color"];
4849
}
4950
}

0 commit comments

Comments
 (0)