summaryrefslogtreecommitdiff
path: root/src/components/ui/button.test.tsx
diff options
context:
space:
mode:
authorBertrand Yuan <189593334+bertyuan@users.noreply.github.com>2026-03-26 00:19:31 +0800
committerGitHub <noreply@github.com>2026-03-26 00:19:31 +0800
commitf247a8c4a863ec430f4a705b5c493d652c8429bd (patch)
tree71d0985970984c105582f6e3c370b254f38e9bbe /src/components/ui/button.test.tsx
parentf7a02fe0e112cf108fc5f22872f1efc077e99fe8 (diff)
parentcd3c4bc89c169616b38bdb7443bb4eb7571b020c (diff)
Merge pull request #12 from bertyuan/fix-vitestv1.1
Fix vitest
Diffstat (limited to 'src/components/ui/button.test.tsx')
-rw-r--r--src/components/ui/button.test.tsx15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/components/ui/button.test.tsx b/src/components/ui/button.test.tsx
index 314e9bf..f8bd3a9 100644
--- a/src/components/ui/button.test.tsx
+++ b/src/components/ui/button.test.tsx
@@ -14,9 +14,16 @@ describe('Button', () => {
// Test buttons with different variants
test('renders button with different variants', () => {
- const variants = ['default', 'destructive', 'outline', 'secondary', 'ghost', 'link'];
+ const variants = [
+ 'default',
+ 'destructive',
+ 'outline',
+ 'secondary',
+ 'ghost',
+ 'link',
+ ] as const;
variants.forEach((variant) => {
- render(<Button variant={variant as any}>{variant} Variant</Button>);
+ render(<Button variant={variant}>{variant} Variant</Button>);
const button = screen.getByText(`${variant} Variant`);
expect(button).toBeInTheDocument();
});
@@ -24,9 +31,9 @@ describe('Button', () => {
// Test buttons with different sizes
test('renders button with different sizes', () => {
- const sizes = ['default', 'sm', 'lg', 'icon'];
+ const sizes = ['default', 'sm', 'lg', 'icon'] as const;
sizes.forEach((size) => {
- render(<Button size={size as any}>{size} Size</Button>);
+ render(<Button size={size}>{size} Size</Button>);
const button = screen.getByText(`${size} Size`);
expect(button).toBeInTheDocument();
});