From 92e54fb3c7e0e050afe6610c32c5ab77ce4a56f6 Mon Sep 17 00:00:00 2001 From: Ernesto Gonzalez <60261375+UmiKami@users.noreply.github.com> Date: Thu, 6 Jul 2023 19:01:20 +0000 Subject: [PATCH 1/3] fixed conditioonals in test to allow more possible solutions and be more flexible --- exercises/07-Very-Specific-Rules/tests.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/07-Very-Specific-Rules/tests.js b/exercises/07-Very-Specific-Rules/tests.js index 4e1d6655..be39e38a 100644 --- a/exercises/07-Very-Specific-Rules/tests.js +++ b/exercises/07-Very-Specific-Rules/tests.js @@ -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 === 'green').toBeTruthy(); }) test("The odd rows of the table should have yellow background", ()=>{ @@ -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.toLowerCase() === "yellow").toBeTruthy(); }) test("Write all your rules above the existing code", ()=>{ From ba2b37d8bbc8f9a609c7aab9b9ef2a5e2f2b81fe Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez <56565994+tommygonzaleza@users.noreply.github.com> Date: Thu, 6 Jul 2023 17:08:26 -0400 Subject: [PATCH 2/3] Update tests.js --- exercises/07-Very-Specific-Rules/tests.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/07-Very-Specific-Rules/tests.js b/exercises/07-Very-Specific-Rules/tests.js index be39e38a..4d2bfb66 100644 --- a/exercises/07-Very-Specific-Rules/tests.js +++ b/exercises/07-Very-Specific-Rules/tests.js @@ -52,7 +52,7 @@ describe("All the styles should be applied", ()=>{ backgroundColor = backgroundColor.toLowerCase() } - } expect(background && background === 'green' || backgroundColor === 'green').toBeTruthy(); + } expect((background && background === 'green') || (backgroundColor && backgroundColor === 'green')).toBeTruthy(); }) test("The odd rows of the table should have yellow background", ()=>{ @@ -95,4 +95,4 @@ describe("All the styles should be applied", ()=>{ expect(title).toBeTruthy() }) -}); \ No newline at end of file +}); From 5aa891670ca8b26207823b0549d5894f9b9e7fec Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez <56565994+tommygonzaleza@users.noreply.github.com> Date: Thu, 6 Jul 2023 17:09:03 -0400 Subject: [PATCH 3/3] Update tests.js --- exercises/07-Very-Specific-Rules/tests.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/07-Very-Specific-Rules/tests.js b/exercises/07-Very-Specific-Rules/tests.js index 4d2bfb66..f141c357 100644 --- a/exercises/07-Very-Specific-Rules/tests.js +++ b/exercises/07-Very-Specific-Rules/tests.js @@ -70,7 +70,7 @@ describe("All the styles should be applied", ()=>{ } - } expect(background && 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", ()=>{