mirror of
https://github.com/stablyai/orca.git
synced 2026-10-16 16:03:26 +00:00
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:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user