mirror of
https://github.com/vitest-dev/vitest.git
synced 2025-12-08 18:26:03 +00:00
24 lines
749 B
TypeScript
24 lines
749 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()
|
|
})
|
|
|
|
it('uses flexbox in app header', async () => {
|
|
render(<App />)
|
|
const element = screen.getByRole('banner')
|
|
expect(element.className).toEqual('App-header')
|
|
expect(getComputedStyle(element).display).toEqual('flex')
|
|
})
|
|
})
|