Skip to content

Commit

Permalink
test: ✅ enhance <XLink /> tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmy-guzman committed Nov 30, 2023
1 parent 394fb0f commit 91d61f1
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/components/XLink.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@ import { render, screen } from '@/test/utils'

import { XLink } from './XLink'

describe('logo', () => {
it('should render link and image', () => {
render(<XLink to='Vite' />)
describe('XLink', () => {
it.each([
'Vite',
'React',
'TypeScript',
'tailwindcss',
'GitHub',
'Deploy',
] as const)('should render %s link', (to) => {
render(<XLink to={to} />)

expect(screen.getByRole('link', { name: /vite/i })).toBeInTheDocument()
expect(screen.getByRole('link', { name: to })).toBeInTheDocument()
})
})

0 comments on commit 91d61f1

Please sign in to comment.