Files
supabase/apps/studio/tests/pages/projects/LogsQueryPanel.test.tsx
T
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

31 lines
831 B
TypeScript

import { screen } from '@testing-library/react'
import { expect, test, vi } from 'vitest'
import LogsQueryPanel from 'components/interfaces/Settings/Logs/LogsQueryPanel'
import { render } from 'tests/helpers'
test('run and clear', async () => {
const mockRun = vi.fn()
const mockClear = vi.fn()
render(
<LogsQueryPanel
defaultFrom=""
defaultTo=""
isLoading={false}
onDateChange={() => {}}
onSelectSource={() => {}}
onSelectTemplate={() => {}}
warnings={[]}
onClear={mockClear}
hasEditorValue
warehouseCollections={[]}
dataSource="logs"
onDataSourceChange={() => {}}
templates={[]}
warehouseTemplates={[]}
onSelectWarehouseTemplate={() => {}}
/>
)
await expect(screen.findByPlaceholderText(/Search/)).rejects.toThrow()
})