-
Notifications
You must be signed in to change notification settings - Fork 9
test: resolve interdependency between search page tests #1748
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Coverage of commit
|
|
With regards to moving |
|
👍 Thanks @lemald, I'll rework this PR to move I suspsect that one possible user-facing added benefit of moving
I expect with this change, the VPP would stay on the block minischedule when switching between modes. Before making this change I can confirm with product in the ticket whether the existing behavior is intended. |
Ah, yes, that's also a good point! I suspect you're correct about how it will work with the change, and it should be a nice (if small) UX improvement. |
Coverage of commit
|
Coverage of commit
|
lemald
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Coverage of commit
|
There may still need to be a cleanup added for this hook, but it isn't immediately causing issues with the tests and will be investigated as part of a separate ticket
7c55d10 to
afa58c1
Compare
Coverage of commit
|
lemald
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Latest changes look good!
Coverage of commit
|
Coverage of commit
|
ticket: https://app.asana.com/0/1152340551558956/1203058157664665/f
This PR refactors
<RightPanel>so thatPagecomponent tests are no longer also testing theRightPanelcomponent. A separate ticket will further explore possible changes touseSocketbased on the findings in the discussion of this PR.Previous WIP notes
This PR currently includes some changes that resolved the console errors previously seen in the test file. I don't see this PR as it stands now as a comprehensive approach to resolving this issue, but want to document what I've found so farPrior to these changes:
SearchPage.test.tsxat once with "renders a selected vehicle" before "on mobile, allows you to toggle to the map view and back again": both tests succeed, but console errors loggedSearchPage.test.tsxat once with "renders a selected vehicle" after "on mobile, allows you to toggle to the map view and back again": both tests succeed, no console errors logged.Isolating the issue:
selectedVehicleOrGhostfrom state in "renders a selected vehicle": both tests succeed, no console errors loggedasync/awaitfrom "on mobile, allows you to toggle to the map view and back again": both tests succeed, no console errors<RightPanel>: both tests succeed, no console errors loggedAfter performing the above tests, I wondered if something about the call to
react-test-renderer.create()in "renders a selected vehicle" wasn't being cleaned up properly before running the next test.react-testing-libraryrenderer instead to avoid errors due to inconsistent renderers within the same fileError: Error: connect ECONNREFUSED 127.0.0.1:80errorsuseSocketto resolveWarning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.While those fixes within the test file resolved the console errors, it raises a few more questions:
<RightPanel>up a level so it is a sibling to these pages rather than a child help to keep these tests isolated?useSockethook not having a cleanup function a real problem, or a symptom of something else missing in the test? I suspect it is a real problem, but have doubts since it is an older area of the code. Though this kind of issue might not have user-facing impactreact-test-rendererfor snapshots overreact-testing-libraryrender+asFragment`?