Skip to content

Commit e0245c7

Browse files
test(react-query-devtools/ReactQueryDevtools): add tests for forwarding 'buttonPosition' and 'position' props to the devtools instance (#10817)
* test(react-query-devtools/ReactQueryDevtools): add tests for forwarding 'buttonPosition' and 'position' props to the devtools instance * ci: apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 3daac67 commit e0245c7

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

packages/react-query-devtools/src/__tests__/ReactQueryDevtools.test.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,26 @@ describe('ReactQueryDevtools', () => {
6262
expect(mountMock).toHaveBeenCalled()
6363
})
6464

65+
it('should forward "buttonPosition" to the devtools instance', async () => {
66+
const { ReactQueryDevtools } = await import('../ReactQueryDevtools')
67+
const queryClient = new QueryClient()
68+
69+
render(
70+
<ReactQueryDevtools client={queryClient} buttonPosition="top-left" />,
71+
)
72+
73+
expect(setButtonPositionMock).toHaveBeenCalledWith('top-left')
74+
})
75+
76+
it('should forward "position" to the devtools instance', async () => {
77+
const { ReactQueryDevtools } = await import('../ReactQueryDevtools')
78+
const queryClient = new QueryClient()
79+
80+
render(<ReactQueryDevtools client={queryClient} position="left" />)
81+
82+
expect(setPositionMock).toHaveBeenCalledWith('left')
83+
})
84+
6585
it('should return null in non-development environments', async () => {
6686
vi.stubEnv('NODE_ENV', 'production')
6787
vi.resetModules()

0 commit comments

Comments
 (0)