Open dschinkel opened 4 years ago
Can anyone help me with this error?
Is this repo dead? Seems like all new issues have gotten no response.
I think you have to mock the location object with something like:
global.window = Object.create(window);
const url = "http://dummy.com";
Object.defineProperty(window, 'location', {
value: {
href: url
}
I don't understand why this would even bomb out, I'm simply trying to import the
A
(link) component to my test.I'm not even exercising this yet in code, why does it ask for location? If It needs it for tests, how do I provide that?
Error:
It's not even my test, I get this same exact problem when I import this into production code, what gives? The docs don't even talk about location.
Here's what I'm trying to do in the corresponding child component:
So when I click it, it should navigate to that route and render the Company Profile page.
Here's my App.tsx:
All your examples show the Root App component but no examples show child components. I don't see a need to have
routeResult
in a child component when if they click a link, it should do a redirect completely out of the current rendered component they are currently in. So how do we get this error resolved and this redirect working here?