From ba7bd4d5c5fd682fffee8736314d03dd01c869af Mon Sep 17 00:00:00 2001 From: brennanb2025 Date: Sat, 27 Jun 2026 12:05:34 -0700 Subject: [PATCH] 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 --- .../src/components/tab-group/TabGroupSplitLayout.test.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/renderer/src/components/tab-group/TabGroupSplitLayout.test.ts b/src/renderer/src/components/tab-group/TabGroupSplitLayout.test.ts index 20613d7a2a1..3f84a81a712 100644 --- a/src/renderer/src/components/tab-group/TabGroupSplitLayout.test.ts +++ b/src/renderer/src/components/tab-group/TabGroupSplitLayout.test.ts @@ -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 = {