From b7fee2848c1b66827a3447f8ffb293578ff8a8cc Mon Sep 17 00:00:00 2001 From: Randell Dawson <5313213+RandellDawson@users.noreply.github.com> Date: Mon, 4 Mar 2019 10:33:02 -0800 Subject: [PATCH] fix(curriculum): Corrected test which allowed wrong solution to pass (#35394) * fix: corret-wrong-checks-in-test * fix: improved robustness of test * fix: added a full working solution for challenge * fix: added && to asssert --- ...ement-using-the-height-property.english.md | 40 +++++++++++++++++-- ...lement-using-the-width-property.english.md | 2 +- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/curriculum/challenges/english/01-responsive-web-design/applied-visual-design/adjust-the-height-of-an-element-using-the-height-property.english.md b/curriculum/challenges/english/01-responsive-web-design/applied-visual-design/adjust-the-height-of-an-element-using-the-height-property.english.md index ec1d4230ac..71bd250387 100644 --- a/curriculum/challenges/english/01-responsive-web-design/applied-visual-design/adjust-the-height-of-an-element-using-the-height-property.english.md +++ b/curriculum/challenges/english/01-responsive-web-design/applied-visual-design/adjust-the-height-of-an-element-using-the-height-property.english.md @@ -22,7 +22,7 @@ Add a height property to the h4 tag and set it to 25px ```yml tests: - text: Your code should change the h4 height property to a value of 25 pixels. - testString: assert($('h4').css('height') == '25px', 'Your code should change the h4 height property to a value of 25 pixels.'); + testString: assert($('h4').css('height') === '25px' && /h4{\S*height:25px(;\S*}|})/.test($('style').text().replace(/\s/g ,''))); ``` @@ -80,7 +80,41 @@ tests: ## Solution
-```js -// solution required +```html + +
+
+
+

Google

+

Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University.

+
+ +
+
```
diff --git a/curriculum/challenges/english/01-responsive-web-design/applied-visual-design/adjust-the-width-of-an-element-using-the-width-property.english.md b/curriculum/challenges/english/01-responsive-web-design/applied-visual-design/adjust-the-width-of-an-element-using-the-width-property.english.md index 5bbfc0997d..9e4e9c05fe 100644 --- a/curriculum/challenges/english/01-responsive-web-design/applied-visual-design/adjust-the-width-of-an-element-using-the-width-property.english.md +++ b/curriculum/challenges/english/01-responsive-web-design/applied-visual-design/adjust-the-width-of-an-element-using-the-width-property.english.md @@ -22,7 +22,7 @@ Add a width property to the entire card and set it to an absolute v ```yml tests: - text: Your code should change the width property of the card to 245 pixels by using the fullCard class selector. - testString: assert(code.match(/.fullCard\s*{[\s\S][^}]*\n*^\s*width\s*:\s*245px\s*;/gm), 'Your code should change the width property of the card to 245 pixels by using the fullCard class selector.'); + testString: assert($('.fullCard').css('width') === '245px' && /\.fullCard{\S*width:245px(;\S*}|})/.test($('style').text().replace(/\s/g ,''))); ```