test(components): [message] add one test case for #20333 (#20513)

* test(components): [message] add one test case for #20333

* fix: error caused by other test cases

After running the test case "it should render vnode function", there is a message in the body
This commit is contained in:
伊墨
2025-04-21 20:56:26 +08:00
committed by GitHub
parent 7dd646e3c1
commit 007635aa4a

View File

@@ -196,4 +196,15 @@ describe('Message on command', () => {
ElMessage._context = null
})
})
// #20333
test('it should destroy self immediately', async () => {
const el = document.createElement('div')
document.body.appendChild(el)
const { close } = Message({ appendTo: el })
close()
await rAF()
expect(el.querySelector(selector)).toBeFalsy()
})
})