import { describe, it, expect } from 'vitest' import { mount } from '@vue/test-utils' import { Switch } from '../src/lib' describe('Switch', () => { it('renders unchecked by default', () => { const wrapper = mount(Switch) expect(wrapper.get('button').attributes('data-state')).toBe('unchecked') }) it('reflects modelValue as checked', () => { const wrapper = mount(Switch, { props: { modelValue: true } }) expect(wrapper.get('button').attributes('data-state')).toBe('checked') }) it('emits update:modelValue on click', async () => { const wrapper = mount(Switch, { props: { modelValue: false } }) await wrapper.get('button').trigger('click') expect(wrapper.emitted('update:modelValue')?.[0]).toEqual([true]) }) })