mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
test: add
This commit is contained in:
committed by
Herrington Darkholme
parent
12abae4b08
commit
9910afa7fc
@@ -47,14 +47,6 @@ describe('Button.vue', () => {
|
||||
expect(buttonElm.classList.contains('is-loading')).toBeTruthy()
|
||||
expect(buttonElm.querySelector('.el-icon-loading')).not.toBeUndefined()
|
||||
})
|
||||
it('disabled', () => {
|
||||
const instance = mount(Button, {
|
||||
props: { disabled: true },
|
||||
...COMMON_CONFIG,
|
||||
})
|
||||
const buttonElm = instance.element
|
||||
expect(buttonElm.classList.contains('is-disabled')).toBeTruthy()
|
||||
})
|
||||
it('size', () => {
|
||||
const instance = mount(Button, {
|
||||
props: { size: 'medium' },
|
||||
@@ -133,4 +125,15 @@ describe('Button.vue', () => {
|
||||
expect(instance.emitted('click')).toBeUndefined()
|
||||
})
|
||||
|
||||
it('disabled', async () => {
|
||||
const instance = mount(Button, {
|
||||
props: { disabled: true },
|
||||
...COMMON_CONFIG,
|
||||
})
|
||||
const buttonElm = instance.element
|
||||
expect(buttonElm.classList.contains('is-disabled')).toBeTruthy()
|
||||
await instance.trigger('click')
|
||||
expect(instance.emitted('click')).toBeUndefined()
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user