Skip to content

Commit

Permalink
Add initial button tests
Browse files Browse the repository at this point in the history
  • Loading branch information
raducristianpopa committed Dec 21, 2023
1 parent a4c7f9c commit cda31f2
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/components/__tests__/button.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { render, screen } from '@testing-library/react'
import React from 'react'

import { Button } from '@/components/button'

describe('Rendering', () => {
describe('Button', () => {
it('should render a button', async () => {
render(<Button aria-label="test button">My Button</Button>)

expect(screen.getByRole('button')).toBeInTheDocument()
})

it('should default to `type="button"`', async () => {
render(<Button aria-label="test-button">My Button</Button>)

expect(screen.getByRole('button')).toHaveAttribute('type', 'button')
})
})
})

0 comments on commit cda31f2

Please sign in to comment.