mars-v2-frontend/__mocks__/helmet.js
Bob van der Helm dee7f5936b
🐛 UNSAFE_COMPONENT error (#439)
* 🐛 UNSAFE_COMPONENT error

* 🐛 fix unit tests for react-helmet-async
2023-09-07 10:37:49 +02:00

17 lines
395 B
JavaScript

jest.mock('react-helmet-async', () => {
const React = require('react')
const plugin = jest.requireActual('react-helmet-async')
const mockHelmet = ({ children, ...props }) =>
React.createElement(
'div',
{
...props,
className: 'mock-helmet',
},
children,
)
return {
...plugin,
Helmet: jest.fn().mockImplementation(mockHelmet),
}
})