mirror of
https://github.com/kremalicious/blog.git
synced 2024-06-10 20:00:09 +02:00
18 lines
495 B
TypeScript
18 lines
495 B
TypeScript
import React, { Suspense } from 'react'
|
|
import { render, fireEvent, waitFor } from '@testing-library/react'
|
|
|
|
import Qr from './Qr'
|
|
|
|
describe('Qr', () => {
|
|
test('renders lazy', async () => {
|
|
const { container } = render(
|
|
<Suspense fallback="test loading">
|
|
<Qr address="xxx" />
|
|
</Suspense>
|
|
)
|
|
expect(container.firstChild).toBeInTheDocument()
|
|
await waitFor(() => container.querySelector('button'))
|
|
fireEvent.click(container.querySelector('button'))
|
|
})
|
|
})
|