mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-21 04:50:14 +08:00
test(input-number): fix showButton
This commit is contained in:
parent
2e3aaa9b34
commit
a4d627c80e
@ -370,6 +370,7 @@ export default defineComponent({
|
||||
onMousedown={this.handleMouseDown}
|
||||
>
|
||||
{{
|
||||
_: 2, // input number has dynamic slots
|
||||
prefix: this.$slots.prefix,
|
||||
suffix: this.showButton
|
||||
? () => [
|
||||
|
@ -8,16 +8,12 @@ describe('n-input-number', () => {
|
||||
})
|
||||
|
||||
it('should work with `show-button` prop', async () => {
|
||||
const wrapper = mount(NInputNumber, {
|
||||
props: {
|
||||
showButton: false
|
||||
}
|
||||
})
|
||||
// Here is a strange case, we must make input number's slots flag to 2
|
||||
// (dynamic) to make it work.
|
||||
const wrapper = mount(NInputNumber)
|
||||
expect(wrapper.findComponent(NButton).exists()).toBe(true)
|
||||
await wrapper.setProps({ showButton: false })
|
||||
expect(wrapper.findComponent(NButton).exists()).toBe(false)
|
||||
|
||||
// expect(wrapper.findComponent(NButton).exists()).toBe(true)
|
||||
|
||||
// await wrapper.setProps({ showButton: false })
|
||||
})
|
||||
|
||||
it('should work with default value', async () => {
|
||||
|
Loading…
Reference in New Issue
Block a user