I have to test a component which renders based on the country and language in the url path params. So I want to the if the components are rendered properly based on the change in params.
I am mocking the useParams and setting some required value which works for most of the tests. Now for a specific case, I need to change the param.
jest.mock('react-router-dom', () => ({
...jest.requireActual('react-router-dom'),
useParams: () => ({
language: 'IT'
})
}));
How do I override the language in test ?
Thank you