mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-06 12:17:13 +08:00
test(message): add message provider closable test (#806)
This commit is contained in:
parent
b62bda5127
commit
aeb4f553ab
@ -87,4 +87,28 @@ describe('message-provider', () => {
|
||||
}, 1200)
|
||||
})
|
||||
})
|
||||
it('props.closable', (done) => {
|
||||
const Test = defineComponent({
|
||||
setup () {
|
||||
const message = useMessage()
|
||||
message.info('string')
|
||||
},
|
||||
render () {
|
||||
return null
|
||||
}
|
||||
})
|
||||
const wrapper = mount(NMessageProvider, {
|
||||
props: {
|
||||
closable: true
|
||||
},
|
||||
slots: {
|
||||
default: () => <Test />
|
||||
}
|
||||
})
|
||||
void nextTick(() => {
|
||||
expect(document.querySelector('.n-message__close')).not.toBe(null)
|
||||
wrapper.unmount()
|
||||
done()
|
||||
})
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user