mirror of
https://github.com/supabase/supabase.git
synced 2026-07-03 07:14:27 +08:00
* Bump all testing libs to force babel to upgrade itself. * Remove react-hooks package, it's included in @testing-library/react. * Add await to all useEvent calls. * Remove duplicate babel/helpers. * Deduplicate babel/core. * Bump vite to non-vuln version. * Bump estree-util-value-to-estree.
15 lines
487 B
TypeScript
15 lines
487 B
TypeScript
import { expect, test, vi } from 'vitest'
|
|
|
|
import { screen } from '@testing-library/dom'
|
|
import userEvent from '@testing-library/user-event'
|
|
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()
|
|
})
|