feat(renderer): add shadcn switch primitive

This commit is contained in:
2026-06-05 17:18:19 +05:30
parent 221598c91b
commit 6b23e5ef60
4 changed files with 70 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
import { describe, it, expect, vi } from 'vitest';
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { Switch } from '@/components/ui/switch';
describe('Switch', () => {
it('toggles checked state', async () => {
const onCheckedChange = vi.fn();
render(<Switch aria-label="airplane" onCheckedChange={onCheckedChange} />);
await userEvent.click(screen.getByRole('switch', { name: /airplane/i }));
expect(onCheckedChange).toHaveBeenCalledWith(true);
});
});