1.1.3
https://github.com/BeniRupp/bug_portal-vue-target-already-exists
Run the unit test example.spec.js. The second test will throw a warning.
The warning target xxx already exists should not be thrown, since each test uses its own localVue instance. There should only exist one portal-target with the name "berlin" in the second test.
The first test pollutes the second test because the portal-target with the given name is already present.
hmmm very weird! Looking into this, I don't see any obvious cause...
I don't know much about portal-vue but looks like you need to destroy the wrapper to unregister the target after each test. See here https://github.com/LinusBorg/portal-vue/blob/da8fed161051cddbeff68fb9907f750adeb2cdb5/src/components/portal-target.tsx#L53
I did w.destroy() after each of your tests, and the warning is now gone.
You could probably use the afterDestroy feature to make this more convenient.
I am not sure this is a bug in Test Utils or not. I feel like localVue should have bee enough so you don't need to do this, but I am not clear on how portal-vue works internally with registering targets. Maybe @LinusBorg has some ideas, he created the portal-vue library.
Yeah this is an unfortunate side-effect of a feature I implemented a while back, it's supposed to warn during dev so you don't accidentally define two targets with the same name.
could be improved/saolved in portal-vue, it's not a bug in test-utils.
Workaround, as mentioned, is to properly unmount after each test.
@lmiller1990 and @LinusBorg thank you very much for your time and the fast response! 馃憦