feat: enhance tutorial functionality by disabling inputs and buttons during active steps
Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 3m12s
Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 3m12s
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import FloatingActionButton from '../FloatingActionButton.vue'
|
||||
|
||||
describe('FloatingActionButton', () => {
|
||||
it('emits click when enabled and clicked', async () => {
|
||||
const wrapper = mount(FloatingActionButton, {
|
||||
props: { ariaLabel: 'Add Child', disabled: false },
|
||||
})
|
||||
|
||||
await wrapper.find('button').trigger('click')
|
||||
expect(wrapper.emitted('click')).toHaveLength(1)
|
||||
})
|
||||
|
||||
it('is disabled and does not emit click when disabled prop is true', async () => {
|
||||
const wrapper = mount(FloatingActionButton, {
|
||||
props: { ariaLabel: 'Add Child', disabled: true },
|
||||
})
|
||||
|
||||
const button = wrapper.find('button')
|
||||
expect((button.element as HTMLButtonElement).disabled).toBe(true)
|
||||
|
||||
await button.trigger('click')
|
||||
expect(wrapper.emitted('click')).toBeUndefined()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user