1
0
mirror of https://github.com/lana-k/sqliteviz.git synced 2025-12-07 02:28:54 +08:00

add test for disabled state for checkBox #27

This commit is contained in:
lana-k
2021-04-13 21:31:35 +02:00
parent 13a8b33815
commit 5c9a5560b7

View File

@@ -36,4 +36,15 @@ describe('CheckBox', () => {
expect(wrapper.emitted().click).to.have.lengthOf(2) expect(wrapper.emitted().click).to.have.lengthOf(2)
expect(wrapper.emitted().click[1]).to.eql([false]) 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')
})
}) })