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

Add support for HTML templates #351

Closed
ddykhoff opened this issue Jan 12, 2018 · 7 comments
Closed

Add support for HTML templates #351

ddykhoff opened this issue Jan 12, 2018 · 7 comments

Comments

@ddykhoff
Copy link

ddykhoff commented Jan 12, 2018

Feature request as suggested in #271 (comment)

Please add support for HTML templates. Main use case is Vue single file components. Example of unsupported use case:

https://jsfiddle.net/h0bnmk5d/1/

And the current work around is to refactor into component template property:

https://jsfiddle.net/h0bnmk5d/2/

@dennythecoder
Copy link
Contributor

Is this something that's going to be included? Testing seems to steer the way we're write code in other contexts. Developers steering away from HTML templates and towards using a main App component is common from what I can tell. It doesn't really seem to create that much more work either.

@eddyerburgh
Copy link
Member

I thought it would be a nice-to-have.

You're right, we should encourage users to use templates in components, rather than HTML templates. But HTML templates make Vue more accessible for users, and the ability to drop vue-test-utils into a codepen of a Vue instance with an HTML template might make testing more approachable to some users.

@ddykhoff
Copy link
Author

ddykhoff commented Apr 12, 2018

My 2 cents is that if this is to be the official testing library of Vue, it should support all features of Vue (or at least the main ones, of which HTML templates and single file components are in my opinion).

@ganicus
Copy link

ganicus commented Sep 11, 2018

What is the work around for this? Do we have to completely refactor our html templates into a template property? Why is there documentation on testing single file components if it isn't fully supported?

@kpturner
Copy link

Having waded through mud to try to test Vue components only to hit this issue with $refs I feel rather deflated to find I have to refactor templates into properties to make this work - especially as they do not have the same editor syntax checking that html templates have.

@dobromir-hristov
Copy link
Contributor

We recently merged a PR, which allows templates as a reference in the element in the DOM - #1320
Closing for now.

@eolamisan
Copy link

It's incredible that this is not supported! Any thoughts on implementing it?
Not sure a large project (800+ components) can or should be converted to properties to add tests.

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

7 participants