fix(challenge): account for browser zoom, add note to challenge (for width challenge) (#37688)

* fix(challenge): account for browser zoom, add note to challenge

* fix(challenge): use regex for width assert

* fix(challenge): remove note

* fix(challenge): revert to initial PR code

* updated regex, add check for maxWidth
This commit is contained in:
lasjorg
2019-12-13 16:05:23 +01:00
committed by Randell Dawson
parent 33cec6b6f2
commit 63b9be8faf

View File

@ -29,7 +29,7 @@ Add a <code>width</code> property to the entire card and set it to an absolute v
```yml
tests:
- text: Your code should change the <code>width</code> property of the card to 245 pixels by using the <code>fullCard</code> class selector.
testString: assert($('.fullCard').css('width') === '245px' && /\.fullCard{\S*width:245px(;\S*}|})/.test($('style').text().replace(/\s/g ,'')));
testString: const fullCard = code.match(/\.fullCard\s*{[\s\S]+?[^}]}/g); assert(fullCard && /width\s*:\s*245px\s*(;|})/gi.test(fullCard[0]) && $('.fullCard').css('maxWidth') === 'none');
```