fix(challenge): simplify and cleanup tests (#35535)

This commit is contained in:
lasjorg 2019-03-27 05:35:38 +01:00 committed by Randell Dawson
parent b10589fadf
commit a1e853337b

View File

@ -25,10 +25,12 @@ Change your <code>h2</code> element's style so that its text color is red.
```yml
tests:
- text: Your <code>h2</code> element should have a <code>style</code> declaration.
testString: assert($("h2").attr('style'));
- text: Your <code>h2</code> element should be red.
testString: assert($("h2").css("color") === "rgb(255, 0, 0)", 'Your <code>h2</code> element should be red.');
testString: assert($("h2").css("color") === "rgb(255, 0, 0)");
- text: Your <code>style</code> declaration should end with a <code>;</code> .
testString: assert(code.match(/<h2\s+style\s*=\s*(\'|")\s*color\s*:\s*(?:rgb\(\s*255\s*,\s*0\s*,\s*0\s*\)|rgb\(\s*100%\s*,\s*0%\s*,\s*0%\s*\)|red|#ff0000|#f00|hsl\(\s*0\s*,\s*100%\s*,\s*50%\s*\))\s*\;(\'|")>\s*CatPhotoApp\s*<\/h2>/),' Your <code>style</code> declaration should end with a <code>;</code> .');
testString: assert($("h2").attr('style') && $("h2").attr('style').endsWith(';'));
```