Stub web project
This commit is contained in:
15
web/src/components/App.test.jsx
Normal file
15
web/src/components/App.test.jsx
Normal file
@@ -0,0 +1,15 @@
|
||||
import { render, screen, fireEvent } from '@testing-library/react'
|
||||
import App from './App'
|
||||
|
||||
describe('App', () => {
|
||||
it('renders without crashing', () => {
|
||||
render(<App />)
|
||||
expect(screen.getByText(/React App/i)).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('calculates correctly when button is clicked', () => {
|
||||
render(<App />)
|
||||
fireEvent.click(screen.getByText(/Calculate/i))
|
||||
expect(screen.getByText(/Result: 8/i)).toBeInTheDocument()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user