-
Notifications
You must be signed in to change notification settings - Fork 792
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
Unit tests don't support DOM API #2030
Comments
@manucorporat , appreciate the quick commit, though not sure this addresses the broader problem? It fixes it for that one function, however there are functions that still aren't exposed/implemented (e.g. |
The DOM api is huge, mock-doc does a best effort trying to mock most of the DOM apis, if you find any api that is not implemented, please open an issue or a PR. appendChild() and removeChild() should be there |
That's very sensible. It seems the actual issue I'm running into is that the |
Stencil version:
I'm submitting a:
[x ] bug report
[ ] feature request
Current behavior:
The Stencil unit tests - specifically,
SpecPage
does not support the DOM API.Expected behavior:
When creating a component using
newSpecPage
, I expect that the component will have access to the DOM API.Steps to reproduce:
The following test fails:
Because
getElementById
is not defined onMockElement
'.Other information:
While
querySelector
can be used as a workaround, in general test will break in other places, especially when using 3rd party components that rely on the DOM API.While I could use E2E tests, they're currently impractical. It takes a minute to re-run a test after a single change due to needing to rebuild all web components.
The text was updated successfully, but these errors were encountered: