fix(learn): Update the regex in Adjust the background-color Property (#39907)
* fix: Updated the regex in background-color test As mentioned by @Skye020 in issue #39823, I have made the semi-colon after the background-colour declaration optional, but only if it is the last declaration in the scope. * Update curriculum/challenges/english/01-responsive-web-design/applied-visual-design/adjust-the-background-color-property-of-text.md Co-authored-by: Shaun Hamilton <51722130+Sky020@users.noreply.github.com> Co-authored-by: Shaun Hamilton <51722130+Sky020@users.noreply.github.com>
This commit is contained in:
@ -26,7 +26,7 @@ Also for the <code>h4</code>, remove the <code>height</code> property and add <c
|
|||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: Your code should add a <code>background-color</code> property to the <code>h4</code> element set to <code>rgba(45, 45, 45, 0.1)</code>.
|
- text: Your code should add a <code>background-color</code> property to the <code>h4</code> element set to <code>rgba(45, 45, 45, 0.1)</code>.
|
||||||
testString: assert(code.match(/(background-color|background):\s*?rgba\(\s*?45\s*?,\s*?45\s*?,\s*?45\s*?,\s*?0?\.1\s*?\);/gi));
|
testString: assert(/(background-color|background):rgba\(45,45,45,0?\.1\)(;?}|;)/gi.test(code.replace(/\s/g, '')));
|
||||||
- text: Your code should add a <code>padding</code> property to the <code>h4</code> element and set it to 10 pixels.
|
- text: Your code should add a <code>padding</code> property to the <code>h4</code> element and set it to 10 pixels.
|
||||||
testString: assert($('h4').css('padding-top') == '10px' && $('h4').css('padding-right') == '10px' && $('h4').css('padding-bottom') == '10px' && $('h4').css('padding-left') == '10px');
|
testString: assert($('h4').css('padding-top') == '10px' && $('h4').css('padding-right') == '10px' && $('h4').css('padding-bottom') == '10px' && $('h4').css('padding-left') == '10px');
|
||||||
- text: The <code>height</code> property on the <code>h4</code> element should be removed.
|
- text: The <code>height</code> property on the <code>h4</code> element should be removed.
|
||||||
|
Reference in New Issue
Block a user