Skip to content

Commit 79b6940

Browse files
committed
Fix autocleanup tests
1 parent 06d3b6c commit 79b6940

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/vue-testing-library.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ function render(
2424
const baseElement = customBaseElement || customContainer || document.body
2525
const container = customContainer || baseElement.appendChild(div)
2626

27-
const attachTo = document.createElement('div')
28-
container.appendChild(attachTo)
29-
3027
// const localVue = createLocalVue()
3128
let vuexStore = null
3229
let router = null
@@ -65,13 +62,16 @@ function render(
6562
// localVue,
6663
// router,
6764
// store: vuexStore,
68-
attachTo,
65+
attachTo: container,
6966
...mountOptions,
7067
...additionalOptions,
7168
})
7269

7370
mountedWrappers.add(wrapper)
74-
container.appendChild(wrapper.element)
71+
72+
// hack to remove id="app"
73+
// this fixes tests in auto-cleanup.js and auto-cleanup-skip.js
74+
wrapper.parentElement.removeAttribute('id')
7575

7676
return {
7777
container,

0 commit comments

Comments
 (0)