mirror of
https://github.com/kremalicious/blog.git
synced 2024-06-28 16:48:00 +02:00
28 lines
787 B
TypeScript
28 lines
787 B
TypeScript
import { test, expect } from 'vitest'
|
|
import { render, fireEvent, screen } from '@testing-library/react'
|
|
import Web3Form from '.'
|
|
|
|
test('Web3Donation component', async () => {
|
|
render(<Web3Form />)
|
|
|
|
const submitButton = screen.getByRole('button')
|
|
expect(submitButton).toBeInTheDocument()
|
|
|
|
const connectButton = screen.getByText('Connect Wallet')
|
|
expect(connectButton).toBeInTheDocument()
|
|
|
|
const input = screen.getByRole('textbox')
|
|
expect(input).toBeInTheDocument()
|
|
|
|
fireEvent.change(input, { target: { value: '1' } })
|
|
expect(input).toHaveValue('1')
|
|
|
|
// Simulate form submission
|
|
// fireEvent.click(submitButton)
|
|
|
|
// await waitFor(() => {
|
|
// const alert = screen.getByText(/Waiting for network confirmation/i)
|
|
// expect(alert).toBeInTheDocument()
|
|
// })
|
|
})
|