Skip to content

test: render the landmark tests from #2026 through the current helpers - #2229

Merged
brian-smith-tcril merged 1 commit into
openedx:masterfrom
brian-smith-tcril:fix-landmark-tests
Oct 26, 2026
Merged

brian-smith-tcril merged 1 commit into
openedx:masterfrom
brian-smith-tcril:fix-landmark-tests

Conversation

@brian-smith-tcril

Copy link
Copy Markdown
Contributor

Summary

Fixes the master build broken by #2026. Test-only change.

#2026's landmark tests were written against a base from before #2110, #2154 and #2168, and the PR merged without its CI running against current master. The merge applied cleanly, but the new tests use test setup that no longer exists:

  • src/courseware/course/Course.test.jsx renders <Course … /> with testStore. Neither is defined in the file anymore, so npm run lint fails with 'Course' is not defined / 'testStore' is not defined and make validate.ci stops before Jest runs.
  • src/tab-page/LoadedTabPage.test.jsx renders LoadedTabPage without a courseId or seeded courseHomeMetaQuery data. LoadedTabPage now throws in that case (covered by "throws when rendered before the course metadata has loaded"), so the error page renders instead:
    • the non-courseware landmark test fails with Unable to find an accessible element with the role "main";
    • the courseware landmark test passes only because the error page has no <main> either.

What changed

  • Course.test.jsx: both landmark tests render through renderCourse(testData), the same as the other tests in the file.
  • LoadedTabPage.test.jsx: renderWithMetadata(courseHomeMetadata, props = {}, { children = null } = {}). The props are spread onto LoadedTabPage after courseId, and the children go in an options object, following renderComponent(props, { children = null, search = '' } = {}) in src/courseware/course/sequence/Unit/index.test.jsx. Both landmark tests render through it with activeTabSlug: 'courseware' / 'outline'.
  • The assertions are unchanged.

Testing

  • npm run lint -- --max-warnings 0: passes
  • npm run types: passes
  • npm run test: 124 of 124 suites and 1285 of 1285 tests pass. Before this change, LoadedTabPage.test.jsx had 1 failure (on top of the lint errors).
  • Both landmark tests now render the real LoadedTabPage. The only LoadedTabPage rendered without course metadata error in the LoadedTabPage.test.jsx run comes from the test that asserts it.

🤖 Generated with Claude Code

… helpers

The landmark tests added in openedx#2026 were written against a base from before
openedx#2110, openedx#2154 and openedx#2168. Course.test.jsx no longer defines Course or
testStore, so lint fails on master; LoadedTabPage now throws without
seeded course metadata, so the non-courseware landmark test failed and the
courseware one passed against the error page.

Course.test.jsx: render through renderCourse, like the rest of the file.
LoadedTabPage.test.jsx: renderWithMetadata takes props and an options
object with children, and both landmark tests render through it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@bradenmacdonald bradenmacdonald 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.

Looks fine to me; good to merge when the build is green.

@bradenmacdonald

Copy link
Copy Markdown
Contributor

Thanks @brian-smith-tcril !

@codecov

codecov Bot commented Oct 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.16%. Comparing base (50faa45) to head (c3cf03a).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2229   +/-   ##
=======================================
  Coverage   96.15%   96.16%           
=======================================
  Files         368      368           
  Lines        6011     6019    +8     
  Branches     1438     1482   +44     
=======================================
+ Hits         5780     5788    +8     
  Misses        222      222           
  Partials        9        9           

☔ View full report in Codecov by Harness.
📢 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.

@brian-smith-tcril
brian-smith-tcril merged commit 230799e into openedx:master Oct 26, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants