Skip to content

feat: [FC-86] Not found page and routing refactoring - #4

Merged
brian-smith-tcril merged 1 commit into
openedx:masterfrom
raccoongang:keblysh/feat/not-found-page
Jun 12, 2025
Merged

feat: [FC-86] Not found page and routing refactoring#4
brian-smith-tcril merged 1 commit into
openedx:masterfrom
raccoongang:keblysh/feat/not-found-page

Conversation

@vladislavkeblysh

Copy link
Copy Markdown
Contributor

Note

This pull request depends on that PR.

Description

Added Not found page

  1. Added NotFound page component with tests
  2. Updated routing

How Has This Been Tested?

  1. Clone this repository
  2. Check that Not found page is displaying on wrong route ("/some-url" by example)

Screenshot 2025-06-01 at 19 54 55

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Jun 1, 2025
@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @vladislavkeblysh!

This repository is currently maintained by @openedx/committers-frontend.

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 approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To 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:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where 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:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@codecov

codecov Bot commented Jun 1, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 96.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 89.09%. Comparing base (b1a42de) to head (9967150).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/index.tsx 75.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Jun 3, 2025
@mphilbrick211 mphilbrick211 added the FC Relates to an Axim Funded Contribution project label Jun 3, 2025
@vladislavkeblysh
vladislavkeblysh force-pushed the keblysh/feat/not-found-page branch from b6f8c2b to 3fdde80 Compare June 4, 2025 08:34

@brian-smith-tcril brian-smith-tcril left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/index.test.jsx Outdated
<Route path="/" element={<HomePage />} />
<Route path="/courses" element={<CatalogPage />} />
<Route path="/courses/:courseId/about" element={<CourseAboutPage />} />
<Route path="*" element={<NotFoundPage />} />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

routes refactored in next PR

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for misunderstanding

Fixed it, please check

import messages from './messages';
import { render } from '../setupTest';

const renderComponent = () => render(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

import NotFoundPage from './NotFoundPage';
import messages from './messages';
import { render } from '../setupTest';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import NotFoundPage from './NotFoundPage';
import messages from './messages';
import { render } from '../setupTest';
import { render } from '../setupTest';
import NotFoundPage from './NotFoundPage';
import messages from './messages';

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@vladislavkeblysh
vladislavkeblysh force-pushed the keblysh/feat/not-found-page branch from e933a28 to 8be4e10 Compare June 11, 2025 15:55
@vladislavkeblysh
vladislavkeblysh force-pushed the keblysh/feat/not-found-page branch 2 times, most recently from a5e0617 to 4fe977c Compare June 11, 2025 16:33

@brian-smith-tcril brian-smith-tcril left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working through the review process with me! This looks great now!

@brian-smith-tcril

Copy link
Copy Markdown
Contributor

@ihor-romaniuk are you happy with how your review on this has been addressed? If so I'll go ahead and merge it!

@vladislavkeblysh
vladislavkeblysh force-pushed the keblysh/feat/not-found-page branch from 4fe977c to 195ba6e Compare June 12, 2025 05:07
@ihor-romaniuk

Copy link
Copy Markdown

@brian-smith-tcril LGTM

@vladislavkeblysh
vladislavkeblysh force-pushed the keblysh/feat/not-found-page branch 2 times, most recently from b048e39 to 2d3803a Compare June 12, 2025 07:16
@vladislavkeblysh
vladislavkeblysh force-pushed the keblysh/feat/not-found-page branch from 2d3803a to 9967150 Compare June 12, 2025 07:19
@vladislavkeblysh vladislavkeblysh changed the title feat: Not found page feat: Not found page and routing refactoring Jun 12, 2025
@vladislavkeblysh vladislavkeblysh changed the title feat: Not found page and routing refactoring feat: [FC-86] Not found page and routing refactoring Jun 12, 2025
@brian-smith-tcril
brian-smith-tcril merged commit 3b11900 into openedx:master Jun 12, 2025
@github-project-automation github-project-automation Bot moved this from Waiting on Author to Done in Contributions Jun 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FC Relates to an Axim Funded Contribution project open-source-contribution PR author is not from Axim or 2U

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

7 participants