Review automated tests #4
Labels
bug
Something isn't working
enhancement
New feature or request
question
Further information is requested
'.body'
selector will need to instead be'body'
. Otherwise,document.querySelector('.body')
returnsnull
here, which is a problem in this context, asnull
gets passed totoHaveStyle
matcher, which throws a type/validation error during the test as the matcher doesn't accept null.https://github.com/SchoolOfCode/workshop_css-variables-b12/blob/35032a34ee5a691156054b2ec923a8c5fca49966/main.test.js#L57
https://github.com/SchoolOfCode/workshop_css-variables-b12/blob/35032a34ee5a691156054b2ec923a8c5fca49966/main.test.js#L88
All the bootcampers failed this particular test I believe for the reason above.
There might be issues with using
toHaveStyle
in conjunction with CSS variables, where the assertion passes even when it shouldn't.styles.css
ourselves (probably a CSS parser on NPM) and make assertions that way.Once the above has been investigated, it might be useful to break the first test up into one test per assertion, just to provide a more granular view when autograding (and so that bootcampers don't have to pass all the assertions to get 1 point). Maybe something like:
The text was updated successfully, but these errors were encountered: