Files
supabase/apps/studio/tests/components/Reports/ReportWidget.test.tsx
Ivan Vasilov cb1e3a8170 chore: Prep work for pnpm (#29610)
* Add all missing libraries in the packages/apps.

* Add all missing Vitest imports to the tests.

* Add some missing exports to ui.

* Fix the admonition export.

* Fix various minor bugs.

* Migrate the ui package to use vitest.
2024-10-01 11:29:37 +02:00

33 lines
737 B
TypeScript

import { screen } from '@testing-library/react'
import ReportWidget from 'components/interfaces/Reports/ReportWidget'
import { test } from 'vitest'
import { render } from '../../helpers'
test('static elements', async () => {
render(
<ReportWidget
isLoading={false}
data={[]}
title="Some chart"
resolvedSql="select"
renderer={() => 'something'}
/>
)
await screen.findByText(/something/)
await screen.findByText(/Some chart/)
})
test('append', async () => {
const appendable = () => 'some text'
render(
<ReportWidget
title="hola"
isLoading={false}
data={[]}
renderer={() => null}
append={appendable}
/>
)
await screen.findByText(/some text/)
})