You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug A clear and concise description of what the bug is.
After manually calling the umount method, cleanupAtWrapper will report an error TypeError: Cannot read properties of null (reading 'parentNode')
To Reproduce Steps to reproduce the behavior:
cleanup should not report an error
Expected behavior
Screenshots
Related information:
@testing-library/vue version: 8.0.2
Vue version: 3.2.33
node version: 16
npm (or yarn) version: pnpm v8
Relevant code or config (if any)
import{createDragDropManager,DragDropManager}from'dnd-core'import{render,cleanup}from'@testing-library/vue'import{useDndContextInjector}from'../DndContext'importDndProviderfrom'../DndProvider'import{TestBackend}from'react-dnd-test-backend'import{defineComponent,h}from'vue-demi'import{describe,afterEach,it,expect}from'vitest'describe('DndProvider',()=>{afterEach(cleanup)it('stores DragDropManager in global context and cleans up on unmount',()=>{letcapturedManagerconstChildComponent=defineComponent(()=>{capturedManager=useDndContextInjector()return()=>null})constTestProvider=defineComponent(()=>{return()=>h(DndProvider,{backend: TestBackend},{default: ()=>h(ChildComponent)})})constmountProvider=()=>render(TestProvider)constglobalInstance=(): DragDropManager=>(globalasany)[Symbol.for('__VUE_DND_CONTEXT_INSTANCE__')]asany// Single mount & unmount worksconstroot=mountProvider()expect(globalInstance()).toEqual(capturedManager)root.unmount()expect(globalInstance()).toEqual(null)// Two mounted components do a refcountconstrootA=mountProvider()constrootB=mountProvider()expect(globalInstance()).toEqual(capturedManager)rootA.unmount()expect(globalInstance()).toEqual(capturedManager)rootB.unmount()expect(globalInstance()).toEqual(null)})})
Additional context
The text was updated successfully, but these errors were encountered:
Describe the bug A clear and concise description of what the bug is.
After manually calling the umount method, cleanupAtWrapper will report an error TypeError: Cannot read properties of null (reading 'parentNode')
To Reproduce Steps to reproduce the behavior:
cleanup should not report an error
Expected behavior
Screenshots
Related information:
@testing-library/vue
version: 8.0.2Vue
version: 3.2.33node
version: 16npm
(oryarn
) version: pnpm v8Relevant code or config (if any)
Additional context
The text was updated successfully, but these errors were encountered: