mirror of
https://github.com/lana-k/sqliteviz.git
synced 2025-12-06 18:18:53 +08:00
add test for disabled state for checkBox #27
This commit is contained in:
@@ -36,4 +36,15 @@ describe('CheckBox', () => {
|
||||
expect(wrapper.emitted().click).to.have.lengthOf(2)
|
||||
expect(wrapper.emitted().click[1]).to.eql([false])
|
||||
})
|
||||
|
||||
it('disabled', async () => {
|
||||
const wrapper = shallowMount(CheckBox, {
|
||||
propsData: { disabled: true }
|
||||
})
|
||||
expect(wrapper.find('.checkbox-container').classes()).to.include('disabled')
|
||||
expect(wrapper.find('.checkbox-container').classes()).to.not.include('checked')
|
||||
await wrapper.trigger('click')
|
||||
expect(wrapper.emitted().click).to.equal(undefined)
|
||||
expect(wrapper.find('.checkbox-container').classes()).to.not.include('checked')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user