diff --git a/frontend/src/components/modals/__tests__/EPGMatchModal.test.jsx b/frontend/src/components/modals/__tests__/EPGMatchModal.test.jsx index 0d5ecbb8..3f149347 100644 --- a/frontend/src/components/modals/__tests__/EPGMatchModal.test.jsx +++ b/frontend/src/components/modals/__tests__/EPGMatchModal.test.jsx @@ -40,6 +40,98 @@ vi.mock('../../../store/settings', () => ({ }), })); +vi.mock('@mantine/core', () => { + const React = require('react'); + + const RadioComponent = ({ label, value, checked, description, groupValue, groupOnChange }) => { + const isChecked = checked !== undefined ? checked : groupValue === value; + const handleChange = groupOnChange || (() => {}); + + return ( + + ); + }; + + RadioComponent.Group = ({ children, value, onChange, label }) => { + // Clone children and inject group props + const enhancedChildren = React.Children.map(children, (child) => { + if (React.isValidElement(child)) { + // If it's a Stack or other container, recursively enhance its children + if (child.type?.name === 'Stack' || child.props['data-testid'] === 'stack') { + return React.cloneElement(child, { + children: React.Children.map(child.props.children, (nestedChild) => { + if (React.isValidElement(nestedChild) && nestedChild.type === RadioComponent) { + return React.cloneElement(nestedChild, { + groupValue: value, + groupOnChange: onChange, + }); + } + return nestedChild; + }), + }); + } + // If it's a Radio component, inject props directly + if (child.type === RadioComponent) { + return React.cloneElement(child, { + groupValue: value, + groupOnChange: onChange, + }); + } + } + return child; + }); + + return ( +