test: fix tests

This commit is contained in:
mathuo 2021-10-02 12:14:16 +01:00
parent c51597fde3
commit db390583d7
2 changed files with 4 additions and 2 deletions

View File

@ -10,5 +10,5 @@ export function setMockRefElement(node: Partial<HTMLElement>): void {
}, },
}; };
jest.spyOn(React, 'useRef').mockReturnValue(mockRef); jest.spyOn(React, 'useRef').mockReturnValueOnce(mockRef);
} }

View File

@ -118,7 +118,9 @@ export const PaneviewReact = React.forwardRef(
React.useEffect(() => { React.useEffect(() => {
if (!paneviewRef.current) { if (!paneviewRef.current) {
return; return () => {
// noop
};
} }
const paneview = paneviewRef.current; const paneview = paneviewRef.current;