mirror of
https://github.com/supabase/supabase.git
synced 2026-12-06 08:29:01 +00:00
21 lines
716 B
TypeScript
21 lines
716 B
TypeScript
import { screen } from '@testing-library/react'
|
|
import userEvent from '@testing-library/user-event'
|
|
import { expect, test, vi } from 'vitest'
|
|
|
|
import { Markdown } from './Markdown'
|
|
import { DOCS_URL } from '@/lib/constants'
|
|
import { customRender } from '@/tests/lib/custom-render'
|
|
|
|
const { track } = vi.hoisted(() => ({ track: vi.fn() }))
|
|
|
|
vi.mock('@/lib/telemetry/track', () => ({ useTrack: () => track }))
|
|
|
|
test('clicking a docs link written in markdown content tracks nothing', async () => {
|
|
const user = userEvent.setup()
|
|
customRender(<Markdown content={`[notes](${DOCS_URL}/text-a-user-typed)`} />)
|
|
|
|
await user.click(screen.getByRole('link', { name: 'notes' }))
|
|
|
|
expect(track).not.toHaveBeenCalled()
|
|
})
|