fix(challenge): simplify and cleanup tests (#35535)
This commit is contained in:
@ -25,10 +25,12 @@ Change your <code>h2</code> element's style so that its text color is red.
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
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.
|
- 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> .
|
- 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(';'));
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user