mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-11-30 02:08:12 +08:00
Fix: complete unit test for radio-button (#173)
This commit is contained in:
parent
e2754a06cd
commit
b7f090da8c
@ -290,11 +290,20 @@ describe('Radio Button', () => {
|
||||
}))
|
||||
const radio1 = wrapper.findComponent({ ref: 'radio1' })
|
||||
const radio2 = wrapper.findComponent({ ref: 'radio2' })
|
||||
const radio3 = wrapper.findComponent({ ref: 'radio3' })
|
||||
const vm = wrapper.vm as any
|
||||
expect(vm.radio).toEqual(6)
|
||||
radio2.trigger('keydown.left')
|
||||
expect(vm.radio).toEqual(3)
|
||||
radio1.trigger('keydown.left')
|
||||
expect(vm.radio).toEqual(9)
|
||||
await nextTick()
|
||||
radio3.trigger('keydown.right')
|
||||
expect(vm.radio).toEqual(3)
|
||||
radio1.trigger('keydown.right')
|
||||
expect(vm.radio).toEqual(6)
|
||||
await nextTick()
|
||||
radio1.trigger('keydown.enter')
|
||||
expect(vm.radio).toEqual(6)
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user