-
Notifications
You must be signed in to change notification settings - Fork 670
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
attachToDocument deprecated and no documented substitute? #1584
Comments
Hi! Thanks for filling this in.
and AFAIK, |
The alternative solution requires a lot of boilerplate code though. Creating a div, appending it to the body, then calling attachTo. Makes one miss the good old times of attachToDocument. |
Also, the solution there leaves a warning, and one should still add:
So the full boilerplate code for every test that uses, say, a dialog, is something like this:
So the convenience of the old attachToDocument is still huge. |
I believe (haven't actually check!) that this is due to Vuetify, which requires a |
Subject of the issue
attachToDocument was deprecated, in favor of attachTo, which is supposed to be more flexible, by allowing any css selector as the mount point.
But what is the actual replacement for attachToDocument: true? attachTo: document.documentElement yields HierarchyRequestError: The operation would yield an incorrect node tree.
Seems like the functionality of attachToDocument was deprecated in favor of something that does not substitute it, but only provides complementary behaviour.
Note that, besides the hierarchy problem, attachTo should be acompanied by wrapper.destroy() at the end. The thing is that this DESTROYS THE NODE to which the wrapper was attached. So, I can attach the element to the body, but the body is going to be destroyed in the call.
What I'm currently doing is adding a dumb routine to each test suite that needs the wrapper to be attached to the dom:
Needless to say, unless I'm missing something, it would be way easier to not have attachToDocument deprecated.
The text was updated successfully, but these errors were encountered: