Skip to content

Instantly share code, notes, and snippets.

View Jasper-Nelligan's full-sized avatar

Jasper Nelligan Jasper-Nelligan

View GitHub Profile
@Jasper-Nelligan
Jasper-Nelligan / ShadcnSelectTest.test.tsx
Last active August 7, 2025 18:32
Testing a Shadcn Select component
import { render, fireEvent, waitFor } from "@testing-library/react";
import { describe, it, expect, vi, beforeEach } from 'vitest';
import '@testing-library/jest-dom';
import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue } from "./ui/select";
function SelectExample() {
return (
<Select>
<SelectTrigger data-testid="select-element">
<SelectValue />