Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -425,12 +425,15 @@ describe('useMinimap', () => {
const minimap = await createAndInitializeMinimap()

await minimap.init()
// The shouldPoll watcher already pauses once while inactive during
// setup. Clear that call so this assertion catches the destroy path.
mockIntervalPause.mockClear()
minimap.destroy()

// Both loops: rAF drives viewport sync, the interval drives change
// detection. One spy each, or deleting either pause here goes unnoticed.
expect(mockPause).toHaveBeenCalled()
expect(mockIntervalPause).toHaveBeenCalled()
expect(mockIntervalPause).toHaveBeenCalledTimes(1)
expect(api.removeEventListener).toHaveBeenCalledWith(
'graphChanged',
expect.any(Function)
Expand Down
Loading