I have a reaction code that I am trying to verify that looks like this:
beforeEach(() => { wrapper = mount( <Provider store={store} > <MyPage params={params} location={location} /> </Provider> ); }); test('renders My Page', () => { expect(wrapper).toMatchSnapshot(); });
I am trying to pass the location using agent-router so that I can access the request parameters on my page and its components. I have a snapshot that works (for example, showing the DOM, etc.), but as soon as I add a wrapper to this new property, undefined is returned.
I debugged this, and it no longer looks like <MyPage ...> rendering. I tried moving the call to <MyPage ...> to my own variable, but that didn't work either. Finally, I also tried changing it from mount to small (not sure if that does). I looked through the docs and I cannot find anything, determining how I can understand why it will not display \ mount.
Are there any tools, methods, or ways to determine why the mounted page \ component does not display \ mount?
EDIT 1
With the help of a colleague, I found out my problem - the problem was using PropTypes.shape instead of PropTypes.shape() . I can reproduce this locally, but none of the online sandbox tools seem to make this simple. Moreover, as it was (with the invalid PropType), he was really silent for fun. So, is there a way to detect this using standard tools and techniques?
source share