We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a2fea02 commit 81fde9cCopy full SHA for 81fde9c
2 files changed
web/src/App.test.tsx
@@ -1,6 +1,14 @@
1
-import { render } from '@testing-library/react'
+import { render, screen } from '@testing-library/react'
2
import App from './App'
3
4
test('renders without crashing', () => {
5
render(<App />)
6
})
7
+test('has an input field', () => {
8
+ render(<App />)
9
+ expect(screen.getByPlaceholderText('Add Task')).toBeDefined()
10
+})
11
+test('has an Add button', () => {
12
13
+ expect(screen.getByText('Add')).toBeDefined()
14
web/src/setupTests.ts
@@ -3,3 +3,9 @@
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom'
+import { cleanup } from '@testing-library/react'
+import { afterEach } from 'vitest'
+
+afterEach(() => {
+ cleanup()
0 commit comments