fix(challenge): account for browser zoom, add note to challenge (for height challenge) (#37687)

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

* fix(challenge): use regex for height assert

* fix(challenge): remove note

* fix(challenge): revert to initial PR code
This commit is contained in:
lasjorg
2019-11-26 04:40:21 +01:00
committed by Randell Dawson
parent 98bb2c1085
commit ba927090fe

View File

@ -21,6 +21,7 @@ img {
## Instructions
<section id='instructions'>
Add a <code>height</code> property to the <code>h4</code> tag and set it to 25px.
<strong>Note:</strong> You may need to be at 100% zoom to pass the test on this challenge.
</section>
## Tests
@ -29,7 +30,7 @@ Add a <code>height</code> property to the <code>h4</code> tag and set it to 25px
```yml
tests:
- text: Your code should change the <code>h4</code> <code>height</code> property to a value of 25 pixels.
testString: assert(document.querySelector('h4').offsetHeight === 25 && /h4{\S*height:25px(;\S*}|})/.test($('style').text().replace(/\s/g ,'')));
testString: assert(Math.round(document.querySelector('h4').getBoundingClientRect().height) === 25 && /h4{\S*height:25px(;\S*}|})/.test($('style').text().replace(/\s/g ,'')));
```