From a3c86dbdff661303a5b3e1957f485eca2eae2414 Mon Sep 17 00:00:00 2001 From: Bertrand Yuan <189593334+bertyuan@users.noreply.github.com> Date: Tue, 7 Apr 2026 11:24:26 +0800 Subject: Revert "A small portion of newly added unit testing code" --- src/components/ui/button.test.tsx | 36 ------------------------------------ 1 file changed, 36 deletions(-) (limited to 'src/components/ui/button.test.tsx') diff --git a/src/components/ui/button.test.tsx b/src/components/ui/button.test.tsx index a15e0a0..f8bd3a9 100644 --- a/src/components/ui/button.test.tsx +++ b/src/components/ui/button.test.tsx @@ -66,40 +66,4 @@ describe('Button', () => { expect(link).toBeInTheDocument(); expect(link.tagName).toBe('A'); }); - - // Test custom className merging - test('merges custom className correctly', () => { - render(); - const button = screen.getByText('Custom Class'); - - // It should have the newly added class - expect(button).toHaveClass('my-custom-test-class'); - // It should also retain the base classes defined in cva - expect(button).toHaveClass('inline-flex', 'items-center'); - }); - - // Test native HTML props forwarding - test('passes native HTML attributes correctly', () => { - render( - - ); - const button = screen.getByTestId('submit-btn'); - - expect(button).toHaveAttribute('type', 'submit'); - expect(button).toHaveAttribute('aria-label', 'Submit Form'); - }); - - // Optimized: Test buttons with different variants by checking classes - test('applies specific classes for different variants', () => { - render(); - const destructiveButton = screen.getByText('Destructive'); - // Verify that the specific Tailwind class from cva is applied - expect(destructiveButton).toHaveClass('bg-destructive', 'text-white'); - - render(); - const outlineButton = screen.getByText('Outline'); - expect(outlineButton).toHaveClass('border', 'bg-background'); - }); }); -- cgit v1.2.3