Skip to content

Commit 7af9fbf

Browse files
autofix-ci[bot]sukvvon
authored andcommitted
ci: apply automated fixes
1 parent 1b7f55e commit 7af9fbf

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

packages/query-devtools/src/__tests__/Devtools.test.tsx

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,7 @@ describe('Devtools', () => {
268268

269269
queryClient.setQueryData(['new'], 'hello')
270270

271-
expect(
272-
rendered.getByLabelText(/Query key \["new"\]/),
273-
).toBeInTheDocument()
271+
expect(rendered.getByLabelText(/Query key \["new"\]/)).toBeInTheDocument()
274272
})
275273

276274
it('should filter queries by "queryHash"', () => {
@@ -315,14 +313,12 @@ describe('Devtools', () => {
315313
try {
316314
fireEvent.click(rendered.getByLabelText('Clear query cache'))
317315

318-
expect(listener).toHaveBeenCalled()
319-
const event = listener.mock.calls[0]?.[0] as CustomEvent
320-
expect(event.detail.type).toBe('CLEAR_MUTATION_CACHE')
321-
} finally {
322-
window.removeEventListener(
323-
'@tanstack/query-devtools-event',
324-
listener,
316+
const dispatched = listener.mock.calls.some(
317+
([e]) => (e as CustomEvent).detail.type === 'CLEAR_MUTATION_CACHE',
325318
)
319+
expect(dispatched).toBe(true)
320+
} finally {
321+
window.removeEventListener('@tanstack/query-devtools-event', listener)
326322
}
327323
})
328324
})

0 commit comments

Comments
 (0)