I wrote a tooltip using popperjs 2.2.1, and jest/enzyme tests. However, I get the following error:
Error: Cannot read property 'split' of undefined
console.error ../../node_modules/@popperjs/core/dist/cjs/popper.js:630
Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.
Tried all of the recommendations in (maybe did it wrong as I am just getting into jest): https://github.com/popperjs/popper-core/issues/478 and https://github.com/popperjs/react-popper/issues/263
I recreated it in the codesandbox: https://codesandbox.io/s/tooltip-test-r8nqt?file=/src/Tooltip.spec.tsx
Any advice? tnx
You are not providing a
placement
property in thedefaultProps
object of your tests.