test(tooltip): update test (#2255)

This commit is contained in:
XieZongChen 2022-01-24 16:42:28 +08:00 committed by GitHub
parent 93b0d7f22b
commit 04ba253c2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,4 +9,19 @@ describe('n-tooltip', () => {
}
})
})
it('should work with `show` props', async () => {
const wrapper = mount(NTooltip, {
slots: {
default: () => 'test-default',
trigger: () => 'test-trigger'
},
attachTo: document.body
})
expect(document.querySelector('.n-tooltip')).toEqual(null)
await wrapper.setProps({ show: true })
expect(document.querySelector('.n-tooltip')).not.toEqual(null)
wrapper.unmount()
})
})