-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
jest-dom
added additional condition to toBeVisible
preventing use in component test.
#102
Comments
@bigopon does this make sense to you? is there any way to fix this from the aurelia plugin? |
you can see from the code here, the elements are supposed to be in the document if they are resolved from Line 53 in 2c4bdea
Can you check again? |
If you look at the screenshot,
|
@bigopon I did some digging and found a issue, it looks like this is how it was fixed for They can mount the component to the document body within the testing framework, can you add something similar to |
As you can see from this line testing/src/component-tester.ts Line 72 in 2c4bdea
All tests attach their root node to the document. So it's unlikely that the issue is in this package. Maybe your jsdom dep is old, and doesn't have getRootNode() implemented, if so, maybe upgrade jsdom?
|
it looks like jsdom first introduced it looks like the |
@bigopon I have opened a ticket with |
@bigopon I just realise we use a import "aurelia-polyfills";
import { Options } from "aurelia-loader-nodejs";
import { globalize } from "aurelia-pal-nodejs";
Options.relativeToDir = "app";
globalize(); I had a look at or is that abstraction just for the things that aurelia needs? |
That could possibly be the case. Maybe it should. Can you try add that in your local |
I'm submitting a bug report
1.1.0
Please tell us about your environment:
Operating System:
Windows 11
Node Version:
16.5.0
NPM Version:
7.20.0
JSPM OR Webpack AND Version
webpack: 5.72.1
Browser:
jest component test
Language:
typescript
Current behavior:
We recently updated our dependencies and it looks like jest-dom changed the behaviour of
toBeVisible
and added a new condition inv5.11.10
so all versions since then (2021-03-25) have the same issue:This is causing our component tests to fail with an exception, when we locate an element from the component and try to asset that it is visible.
I am assuming this can be fixed somehow by a change in the aurelia-testing package.
Expected/desired behavior:
it should not fail or throw an exception
What is the expected behavior?
What is the motivation / use case for changing the behavior?
the jest-dom package has added an extra condition to its
toBeVisible
method.The text was updated successfully, but these errors were encountered: