Skip to content

Wrapper.contains doesn't work with innerHTML #361

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

Closed
hiendv opened this issue Jan 19, 2018 · 3 comments
Closed

Wrapper.contains doesn't work with innerHTML #361

hiendv opened this issue Jan 19, 2018 · 3 comments
Labels

Comments

@hiendv
Copy link
Contributor

hiendv commented Jan 19, 2018

Version

1.0.0-beta.10

Reproduction link

https://github.com/hiendv/vue-test-utils-contains-bug

Steps to reproduce

npm install
npm test

What is expected?

There is no error when running the test component contains the SVG

What is actually happening?

The test fails

@LinusBorg
Copy link
Member

LinusBorg commented Jan 19, 2018

I'm not 100% sure, but (at least until recently), contains does not match the root node - that's what is does.

expect(wrapper.is('svg')).toBeTruthy()

If that's not it, I could imagine that adding html with domProps isn't "visible"until the next tick ...

@eddyerburgh
Copy link
Member

@LinusBorg contains now matches the root node.

@hiendv
Copy link
Contributor Author

hiendv commented Jan 22, 2018

@LinusBorg FYI, in the reproduction, it's not the root node.

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

No branches or pull requests

3 participants