Skip to content

fixed conditioonals in test to allow more possible solutions and be m… #125

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions exercises/07-Very-Specific-Rules/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe("All the styles should be applied", ()=>{
backgroundColor = backgroundColor.toLowerCase()
}

} expect(background === 'green' || backgroundColor === 'green').toBeTruthy();
} expect((background && background === 'green') || (backgroundColor && backgroundColor === 'green')).toBeTruthy();
})

test("The odd rows of the table should have yellow background", ()=>{
Expand All @@ -64,13 +64,13 @@ describe("All the styles should be applied", ()=>{
let background = "";
let backgroundColor = "";
for (let i = 0; i < cssArray.length; i++) {
if (cssArray[i].selectorText === "tr:nth-child(odd)") {
if (cssArray[i].selectorText.includes( "tr:nth-child(odd)")) {
background = cssArray[i].style['background'];
backgroundColor = cssArray[i].style['background-color'];

}

} expect(background.toLowerCase() === "yellow" || backgroundColor.toLowerCase() === "yellow").toBeTruthy();
} expect((background && background.toLowerCase() === "yellow") || (backgroundColor && backgroundColor.toLowerCase() === "yellow")).toBeTruthy();
})

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

});
});