Skip to content

Commit 5119f57

Browse files
authored
Update destroy.spec.js
1 parent 319e7da commit 5119f57

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/specs/wrapper/destroy.spec.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ describeWithShallowAndMount('destroy', mountingMethod => {
4040
expect(wrapper.vm.$el.parentNode).to.be.null
4141
})
4242

43+
it('removes functional component element from document.body', () => {
44+
const wrapper = mountingMethod(
45+
{ template: '<div />', functional: true },
46+
{ attachToDocument: true }
47+
)
48+
expect(wrapper.element.parentNode).to.equal(document.body)
49+
wrapper.destroy()
50+
expect(wrapper.element.parentNode).to.be.null
51+
})
52+
4353
it('throws if component throws during destroy', () => {
4454
const TestComponent = {
4555
template: '<div :p="a" />',

0 commit comments

Comments
 (0)