feat(client, learn): add helper functions for common validation operations (#38605)
Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>
This commit is contained in:
@ -33,7 +33,7 @@ tests:
|
||||
- text: Your <code>blue-box</code> class should give the left of elements <code>40px</code> of <code>margin</code>.
|
||||
testString: assert($(".blue-box").css("margin-left") === "40px");
|
||||
- text: You should use the clockwise notation to set the margin of <code>blue-box</code> class.
|
||||
testString: const removeCssComments = str => str.replace(/\/\*[\s\S]+?\*\//g, '');assert(/\.blue-box\s*{[\s\S]*margin[\s]*:\s*\d+px\s+\d+px\s+\d+px\s+\d+px(;\s*[^}]+\s*}|;?\s*})/.test(removeCssComments($('style').text())));
|
||||
testString: assert(/\.blue-box\s*{[\s\S]*margin[\s]*:\s*\d+px\s+\d+px\s+\d+px\s+\d+px(;\s*[^}]+\s*}|;?\s*})/.test(__helpers.removeCssComments($('style').text())));
|
||||
|
||||
```
|
||||
|
||||
|
@ -32,7 +32,7 @@ tests:
|
||||
- text: Your <code>blue-box</code> class should give the left of elements <code>40px</code> of <code>padding</code>.
|
||||
testString: assert($(".blue-box").css("padding-left") === "40px");
|
||||
- text: You should use the clockwise notation to set the padding of <code>blue-box</code> class.
|
||||
testString: const removeCssComments = str => str.replace(/\/\*[\s\S]+?\*\//g, '');assert(/\.blue-box\s*{[\s\S]*padding[\s]*:\s*\d+px\s+\d+px\s+\d+px\s+\d+px(;\s*[^}]+\s*}|;?\s*})/.test(removeCssComments($('style').text())));
|
||||
testString: assert(/\.blue-box\s*{[\s\S]*padding[\s]*:\s*\d+px\s+\d+px\s+\d+px\s+\d+px(;\s*[^}]+\s*}|;?\s*})/.test(__helpers.removeCssComments($('style').text())));
|
||||
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user