import { mount } from '@vue/test-utils'
import UISwitch from '../Switch.vue'
import { describe, it, expect } from 'vitest'

describe('Switch.vue', () => {
    it('emits update:modelValue when toggled', async () => {
        const wrapper = mount(UISwitch, {
            props: { modelValue: false },
        })
        // the headlessui switch renders a button element
        await wrapper.find('button').trigger('click')
        expect(wrapper.emitted()['update:modelValue']).toBeTruthy()
    })
}) 