feat: [FC-86] Not found page and routing refactoring - #4
Conversation
|
Thanks for the pull request, @vladislavkeblysh! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
ceec09d to
b6f8c2b
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4 +/- ##
===========================================
+ Coverage 24.32% 89.09% +64.76%
===========================================
Files 6 10 +4
Lines 37 55 +18
===========================================
+ Hits 9 49 +40
+ Misses 28 6 -22 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
b6f8c2b to
3fdde80
Compare
brian-smith-tcril
left a comment
There was a problem hiding this comment.
Overall this is looking good. Found one problem with the routing tests that I should have noticed earlier that I'd like to address before landing this.
| <Route path="/" element={<HomePage />} /> | ||
| <Route path="/courses" element={<CatalogPage />} /> | ||
| <Route path="/courses/:courseId/about" element={<CourseAboutPage />} /> | ||
| <Route path="*" element={<NotFoundPage />} /> |
There was a problem hiding this comment.
I'm not sure how I didn't catch this when reviewing #3, but having these routes hardcoded into this test file makes them useless. It is 100% possible these tests to pass while index.tsxis routing incorrectly.
There was a problem hiding this comment.
routes refactored in next PR
There was a problem hiding this comment.
There are now 2 PRs open following this pattern. This is not an acceptable pattern as it does not test anything. I would like to land the PR fixing this first to avoid landing more PRs that follow this pattern.
There was a problem hiding this comment.
This still isn't quite where it needs to be. As of 50bee4a the previous describe('App routing' tests have been completely removed.
The goal is to test that components are rendered at the appropriate routes.
Before: There were tests that looked like they were verifying components were rendered at appropriate routes, but the tests were using a router defined in the test file instead of the router in index.jsx.
Now: There are no tests verifying components are rendered at the appropriate routes.
What I want to see: Tests verifying components are rendered at the appropriate routes in the router from index.tsx.
There was a problem hiding this comment.
sorry for misunderstanding
Fixed it, please check
| import messages from './messages'; | ||
| import { render } from '../setupTest'; | ||
|
|
||
| const renderComponent = () => render( |
There was a problem hiding this comment.
[nit] I don't think that we will have many test cases here. So we can use render(<NotFoundPage />); directly in test without creating a variable.
| import NotFoundPage from './NotFoundPage'; | ||
| import messages from './messages'; | ||
| import { render } from '../setupTest'; |
There was a problem hiding this comment.
| import NotFoundPage from './NotFoundPage'; | |
| import messages from './messages'; | |
| import { render } from '../setupTest'; | |
| import { render } from '../setupTest'; | |
| import NotFoundPage from './NotFoundPage'; | |
| import messages from './messages'; |
e933a28 to
8be4e10
Compare
a5e0617 to
4fe977c
Compare
brian-smith-tcril
left a comment
There was a problem hiding this comment.
Thanks for working through the review process with me! This looks great now!
|
@ihor-romaniuk are you happy with how your review on this has been addressed? If so I'll go ahead and merge it! |
4fe977c to
195ba6e
Compare
|
@brian-smith-tcril LGTM |
b048e39 to
2d3803a
Compare
2d3803a to
9967150
Compare
Note
This pull request depends on that PR.
Description
Added Not found page
How Has This Been Tested?