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

Wrapper.find() does not work in IE11 without polyfill #1223

Closed
markbrouch opened this issue May 2, 2019 · 1 comment
Closed

Wrapper.find() does not work in IE11 without polyfill #1223

markbrouch opened this issue May 2, 2019 · 1 comment

Comments

@markbrouch
Copy link
Contributor

Version

1.0.0-beta.29

Reproduction link

https://github.com/eddyerburgh/vue-test-utils-karma-example

Steps to reproduce

Using Karma test runner in IE11 environment, run the Counter.spec.js test.

What is expected?

wrapper.find('button') should return a wrapper of the matching element.

What is actually happening?

No match is returned and an error is thrown that trigger must be provided a non-empty wrapper.


This is due to IE11 not supporting Element.matches(). Intead IE11 has the non-standard Element.msMatchesSelector(). MDN has a simple polyfill that should be implemented and solves this problem:

if (!Element.prototype.matches) {
  Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
}

I'm happy to open a PR to fix this, I just don't know where the correct place to install this polyfill would be.

@eddyerburgh
Copy link
Member

Thank you for raising this issue. Yes please raise a PR adding the polyfilll in

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

No branches or pull requests

2 participants