-
Notifications
You must be signed in to change notification settings - Fork 668
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
Template querySelector support #1320
Template querySelector support #1320
Conversation
A few notes:
|
This is a great addition! Nice job. As pointed out, try something like Your suspicion about mutating window/document were correct @dobromir-hristov. For this reason, before and after each test, the window variable is reset, to keep things clean. See here. I'm happy to approve this once
Are you able to make these changes, @earnubs ? |
test/specs/mount.spec.js
Outdated
@@ -161,6 +161,26 @@ describeRunIf(process.env.TEST_ENV !== 'node', 'mount', () => { | |||
expect(wrapper.html()).to.equal(`<div>foo</div>`) | |||
}) | |||
|
|||
it('compiles templates from querySelector', () => { | |||
if ( | |||
!(navigator.userAgent.includes && navigator.userAgent.includes('node.js')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comments
8a4c379
to
e1c1b95
Compare
Test is failing, I'll take a look at this tonight when I have a bit more time. |
Hey @earnubs, thank you for your time and effort spent on this PR, contributions like yours help make Vue better for everyone. Cheers! 💚 |
Handle selectors passed in the
template
option of the Vue instance (https://vuejs.org/v2/api/#template), currently test-utils gives an unfriendly error as the selector is passed as a template string:Repro here: https://jsfiddle.net/earnubs/c5d2mea7/