mirror of
https://github.com/supabase/supabase.git
synced 2026-10-08 02:45:07 +03:00
* Fix tests in tests/unit, tests/components and files under tests, looking into tests/pages * Fix tests under pages/projects root * Fix * Comment out broken tests that im stuck with * Fix api-report.test * Fix storage-report-test * chore: fix some tests * chore: remove logging * Fix LogsPreviewer.test.js * Fix most of logs-query-test * Skip broken tests instead of false positiving them --------- Co-authored-by: TzeYiing <ty@tzeyiing.com>
32 lines
776 B
JavaScript
32 lines
776 B
JavaScript
import LogEventChart from 'components/interfaces/Settings/Logs/LogEventChart'
|
|
import { screen } from '@testing-library/react'
|
|
import { render } from '../../helpers'
|
|
|
|
const { ResizeObserver } = window
|
|
|
|
beforeEach(() => {
|
|
delete window.ResizeObserver
|
|
window.ResizeObserver = jest.fn().mockImplementation(() => ({
|
|
observe: jest.fn(),
|
|
unobserve: jest.fn(),
|
|
disconnect: jest.fn(),
|
|
}))
|
|
})
|
|
|
|
afterEach(() => {
|
|
window.ResizeObserver = ResizeObserver
|
|
jest.restoreAllMocks()
|
|
})
|
|
|
|
test('renders chart', async () => {
|
|
const mockFn = jest.fn()
|
|
const tsMicro = new Date().getTime() * 1000
|
|
render(
|
|
<LogEventChart
|
|
data={[{ timestamp: tsMicro }, { timestamp: tsMicro + 1 }]}
|
|
onBarClick={mockFn}
|
|
/>
|
|
)
|
|
await screen.findByText(/Logs \/ Time/)
|
|
})
|