mirror of
https://github.com/supabase/supabase.git
synced 2026-05-07 17:30:25 -04:00
15 lines
491 B
TypeScript
15 lines
491 B
TypeScript
import { screen } from '@testing-library/dom'
|
|
import userEvent from '@testing-library/user-event'
|
|
import { expect, test, vi } from 'vitest'
|
|
|
|
import CopyButton from '@/components/ui/CopyButton'
|
|
import { render } from '@/tests/helpers'
|
|
|
|
test('shows copied text', async () => {
|
|
const callback = vi.fn()
|
|
render(<CopyButton text="some text" onClick={callback} />)
|
|
await userEvent.click(await screen.findByText('Copy'))
|
|
await screen.findByText('Copied')
|
|
expect(callback).toBeCalled()
|
|
})
|