Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions packages/query-devtools/src/__tests__/Devtools.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,32 @@ describe('Devtools', () => {

expect(open).toHaveBeenCalled()
})

it('should log and reset "pip_open" when the browser blocks the popup', () => {
vi.stubGlobal(
'open',
vi.fn(() => null),
)
const consoleError = vi
.spyOn(console, 'error')
.mockImplementation(() => {})

try {
renderDevtools(
{ initialIsOpen: true },
{ 'TanstackQueryDevtools.pip_open': 'true' },
)

expect(consoleError).toHaveBeenCalledWith(
expect.stringContaining('Failed to open popup'),
)
expect(localStorage.getItem('TanstackQueryDevtools.pip_open')).toBe(
'false',
)
} finally {
consoleError.mockRestore()
}
})
Comment thread
coderabbitai[bot] marked this conversation as resolved.
})

describe('status counts', () => {
Expand Down
Loading