mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 09:55:06 +03:00
init fixing tests with a container for Providers needed
This commit is contained in:
1 parent
48199a504c
commit
4e2fd74c6a
2 files changed
+16
-1
No files matched your search
@@ -3,6 +3,7 @@ import { render } from '../../../helpers'
|
||||
import { waitFor, screen } from '@testing-library/react'
|
||||
import { ApiReport } from 'pages/project/[ref]/reports/api-overview'
|
||||
import userEvent from '@testing-library/user-event'
|
||||
import Container from 'tests/setup/container'
|
||||
|
||||
beforeEach(() => {
|
||||
// reset mocks between tests
|
||||
@@ -20,7 +21,11 @@ test(`static elements`, async () => {
|
||||
})
|
||||
|
||||
test('refresh button', async () => {
|
||||
render(<ApiReport />)
|
||||
render(
|
||||
<Container>
|
||||
<ApiReport />
|
||||
</Container>
|
||||
)
|
||||
await waitFor(() => expect(get).toBeCalled())
|
||||
get.mockReset()
|
||||
userEvent.click(await screen.findByText(/Refresh/))
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import * as Tooltip from '@radix-ui/react-tooltip'
|
||||
/**
|
||||
* Test renders can be wrapped in this container if it requires the Providers needed
|
||||
*/
|
||||
|
||||
export default (props) => (
|
||||
<>
|
||||
<Tooltip.Provider>{props.children}</Tooltip.Provider>
|
||||
</>
|
||||
)
|
||||
Reference in new issue
Block a user