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:
Ollie
2020-10-09 19:09:33 +01:00
committed by GitHub
parent b37c493d2f
commit e22adfcc6b

View File

@ -26,7 +26,7 @@ Also for the <code>h4</code>, remove the <code>height</code> property and add <c
```yml
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>.
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.
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.