feat(renderer): add shadcn radio-group primitive

This commit is contained in:
2026-06-05 17:26:29 +05:30
parent 9eb1fe0f00
commit 1d782a00e6
4 changed files with 93 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
import { describe, it, expect, vi } from 'vitest';
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group';
describe('RadioGroup', () => {
it('selects the clicked item', async () => {
const onValueChange = vi.fn();
render(
<RadioGroup onValueChange={onValueChange} defaultValue="a">
<RadioGroupItem value="a" aria-label="A" />
<RadioGroupItem value="b" aria-label="B" />
</RadioGroup>
);
await userEvent.click(screen.getByRole('radio', { name: /b/i }));
expect(onValueChange).toHaveBeenCalledWith('b');
});
});