Skip to content

Commit 9c8d2ea

Browse files
authored
test(preact-query-devtools/PreactQueryDevtools): add tests for forwarding 'buttonPosition' and 'position' props to the devtools instance (#10818)
1 parent e0245c7 commit 9c8d2ea

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

packages/preact-query-devtools/src/__tests__/PreactQueryDevtools.test.tsx

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

65+
it('should forward "buttonPosition" to the devtools instance', async () => {
66+
const { PreactQueryDevtools } = await import('../PreactQueryDevtools')
67+
const queryClient = new QueryClient()
68+
69+
render(
70+
<PreactQueryDevtools 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 { PreactQueryDevtools } = await import('../PreactQueryDevtools')
78+
const queryClient = new QueryClient()
79+
80+
render(<PreactQueryDevtools 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)