Horacio Herrera 9626fdef58
test: update RTL example (#530)
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
2022-01-15 10:59:11 +08:00

17 lines
512 B
TypeScript

import { describe, expect, it } from 'vitest'
import App from './App'
import { render, screen, userEvent } from './utils/test-utils'
describe('Simple working test', () => {
it('the title is visible', () => {
render(<App />)
expect(screen.getByText(/Hello Vite \+ React!/i)).toBeInTheDocument()
})
it('should increment count on click', async() => {
render(<App />)
userEvent.click(screen.getByRole('button'))
expect(await screen.findByText(/count is: 1/i)).toBeInTheDocument()
})
})