Mock refit hook in TabGroupSplitLayout function-invocation test

TabGroupSplitLayout.test.ts calls the component as a plain function to
inspect its element tree, so the new useRefitOnSplitCollapse hook's
useRef/useEffect threw "hooks outside render". Stub the side-effect-only
hook there; its behavior is covered by use-refit-on-split-collapse.test.tsx.

Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
brennanb2025
2026-06-27 12:05:34 -07:00
co-authored by Orca
parent 5fa2dd4f67
commit ba7bd4d5c5
@@ -46,6 +46,14 @@ vi.mock('./useTabDragSplit', () => ({
})
}))
// Why: these cases invoke TabGroupSplitLayout as a plain function (not a
// mounted component) to inspect its element tree, so any real React hook it
// calls would throw. Stub the side-effect-only refit hook out — its behavior
// is covered directly in use-refit-on-split-collapse.test.tsx.
vi.mock('./use-refit-on-split-collapse', () => ({
useRefitOnSplitCollapse: vi.fn()
}))
import TabGroupSplitLayout from './TabGroupSplitLayout'
type ReactElementLike = {