diff --git a/packages/react-hooks/src/useCheckOverflow.test.ts b/packages/react-hooks/src/useCheckOverflow.test.ts index 35c2eb38df..9499e91889 100644 --- a/packages/react-hooks/src/useCheckOverflow.test.ts +++ b/packages/react-hooks/src/useCheckOverflow.test.ts @@ -27,17 +27,21 @@ describe('useCheckOverflow', () => { }); it.each([ + [null, false], [isOverflowing, true], [scrollWidthMatchesOffsetWidth, false], [offsetWidthGreaterThanScrollWidth, false], ])( - 'should check if a Spectrum `DOMRefValue` is overflowing', + 'should check if a Spectrum `DOMRefValue` is overflowing: %s, %s', (el, expected) => { const { result } = renderHook(() => useCheckOverflow()); - const elRef = createMockProxy>({ - UNSAFE_getDOMNode: () => createMockProxy(el), - }); + const elRef = + el == null + ? null + : createMockProxy>({ + UNSAFE_getDOMNode: () => createMockProxy(el), + }); act(() => { result.current.checkOverflow(elRef);