Skip to content

Commit c0587ff

Browse files
committed
test(devtools): wrap getByRole queries with explicit expect statements when the returned element is not used for assertions
1 parent f5c1140 commit c0587ff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ describe('ReactQueryDevtools', () => {
587587
)
588588
expect(sortCombobox.value).toEqual(Object.keys(sortFns)[0])
589589

590-
screen.getByRole('button', { name: /Asc/i })
590+
expect(screen.getByRole('button', { name: /Asc/i })).toBeInTheDocument()
591591

592592
const detailsPanel = screen.queryByText(/Query Details/i)
593593
expect(detailsPanel).not.toBeInTheDocument()
@@ -624,7 +624,7 @@ describe('ReactQueryDevtools', () => {
624624
)
625625
expect(sortCombobox.value).toEqual(Object.keys(sortFns)[1])
626626

627-
screen.getByRole('button', { name: /Desc/i })
627+
expect(screen.getByRole('button', { name: /Desc/i })).toBeInTheDocument()
628628
})
629629

630630
it('should initialize filter value with one stored in localstorage', () => {

0 commit comments

Comments
 (0)