Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

css/vhunit sometimes fails #2580

Open
AnderssonChristian opened this issue Jul 2, 2020 · 3 comments
Open

css/vhunit sometimes fails #2580

AnderssonChristian opened this issue Jul 2, 2020 · 3 comments

Comments

@AnderssonChristian
Copy link
Contributor

AnderssonChristian commented Jul 2, 2020

The css/vhunit test sometimes returns false on Chrome v79/Windows 8.

After some manual debugging it seems getComputedStyle gives height to be 0 instead of the expected 10. I can reproduce this anywhere between 30-70% of the time when I refresh the page.
I also tried commenting out the code that removes #modernizr so that I can inspect it.... Turns out that it always has a 10px height - regardless if the test failed or not.

It feels like some kind of race-condition is going on. Could it be that the styles aren't always applied on time? I have over 30 feature-tests and only this one ever fails.

@kucherenkoag
Copy link

Hi @AnderssonChristian.
I've experienced sort of this recently.
Try to add position: absolute property to the first testStyles argument of vhunit test, like so:

testStyles('#modernizr { height: 50vh; position: absolute; max-height: 10px; }', function (elem) {
  ...
});

@Markel
Copy link
Contributor

Markel commented Sep 3, 2020

@AnderssonChristian did @kucherenkoag's answer solve your problem? Just to add it as a reference to knownBugs while the bug is solved

@Shurna83
Copy link

Hi everyone,
I experience this issue also with Chrome 94 on both Mac OS and Windows when I have a zoom level other than 100%. The exact level of zoom required to break the test seems to vary also according to screen resolution.
Hope this could help in better spotting the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants