From 9e07f99b9e278cdb8225945c414144e4926bfd29 Mon Sep 17 00:00:00 2001 From: Randell Dawson <5313213+RandellDawson@users.noreply.github.com> Date: Sun, 24 Feb 2019 23:07:11 -0800 Subject: [PATCH] fix(curriculum): Added test to validate clockwise notation is used for the Use Clockwise Notation to Specify the Margin of an Element challenge (#35342) * fix: corrected last test which validates clockwise notation * fix: removed helper function * fix: used jQuery to get style and removed extra slash --- ...pecify-the-margin-of-an-element.english.md | 52 ++++++++++++++++--- 1 file changed, 44 insertions(+), 8 deletions(-) diff --git a/curriculum/challenges/english/01-responsive-web-design/basic-css/use-clockwise-notation-to-specify-the-margin-of-an-element.english.md b/curriculum/challenges/english/01-responsive-web-design/basic-css/use-clockwise-notation-to-specify-the-margin-of-an-element.english.md index 04fecca8f8..691d5e411c 100644 --- a/curriculum/challenges/english/01-responsive-web-design/basic-css/use-clockwise-notation-to-specify-the-margin-of-an-element.english.md +++ b/curriculum/challenges/english/01-responsive-web-design/basic-css/use-clockwise-notation-to-specify-the-margin-of-an-element.english.md @@ -24,13 +24,15 @@ Use Clockwise Notation to give the element with the blue-box< ```yml tests: - text: Your blue-box class should give the top of elements 40px of margin. - testString: assert($(".blue-box").css("margin-top") === "40px", 'Your blue-box class should give the top of elements 40px of margin.'); + testString: assert($(".blue-box").css("margin-top") === "40px"); - text: Your blue-box class should give the right of elements 20px of margin. - testString: assert($(".blue-box").css("margin-right") === "20px", 'Your blue-box class should give the right of elements 20px of margin.'); + testString: assert($(".blue-box").css("margin-right") === "20px"); - text: Your blue-box class should give the bottom of elements 20px of margin. - testString: assert($(".blue-box").css("margin-bottom") === "20px", 'Your blue-box class should give the bottom of elements 20px of margin.'); + testString: assert($(".blue-box").css("margin-bottom") === "20px"); - text: Your blue-box class should give the left of elements 40px of margin. - testString: assert($(".blue-box").css("margin-left") === "40px", 'Your blue-box class should give the left of elements 40px of margin.'); + testString: assert($(".blue-box").css("margin-left") === "40px"); + - text: You should use the clockwise notation to set the margin of blue-box class. + testString: const removeCssComments = str => str.replace(/\/\*[\s\S]+?\*\//g, '');assert(/\.blue-box\s*{[\s\S]*margin:\s*\d+px\s+\d+px\s+\d+px\s+\d+px(;[\s\S]*}|\s*)/.test(removeCssComments($('style').text()))); ``` @@ -81,14 +83,48 @@ tests: - - ## Solution
-```js -// solution required +```html + +
margin
+ +
+
padding
+
padding
+
``` +