feat: switch from jest to vitest
This commit is contained in:
parent
8ae7083326
commit
22e3c1dc11
9 changed files with 1043 additions and 407 deletions
24
components/Button/Button.test.tsx
Normal file
24
components/Button/Button.test.tsx
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import { describe, it, expect } from 'vitest'
|
||||
import { render, screen } from '@testing-library/react'
|
||||
import { Button } from './Button'
|
||||
|
||||
describe('Button', () => {
|
||||
it('renders with children', () => {
|
||||
render(<Button href="/test">Click me</Button>)
|
||||
expect(screen.getByText('Click me')).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('applies correct intent classes', () => {
|
||||
const { container } = render(<Button href="/test" intent="secondary">Secondary</Button>)
|
||||
const link = container.querySelector('a')
|
||||
expect(link).toHaveClass('bg-transparent')
|
||||
expect(link).toHaveClass('text-blue-400')
|
||||
})
|
||||
|
||||
it('applies correct size classes', () => {
|
||||
const { container } = render(<Button href="/test" size="sm">Small</Button>)
|
||||
const link = container.querySelector('a')
|
||||
expect(link).toHaveClass('text-sm')
|
||||
expect(link).toHaveClass('min-w-20')
|
||||
})
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue