feat: add exec ed course uuid to exec ed course cards cta button - #26
Open
jono-booth wants to merge 1 commit into
Open
feat: add exec ed course uuid to exec ed course cards cta button#26jono-booth wants to merge 1 commit into
jono-booth wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the executive-education Course Card CTA tracking URLs to optionally include the Exec Ed course UUID as a course_id query parameter, and expands the related unit tests to validate the new behavior.
Changes:
- Append
course_id=<courseUuid>(when available) to Exec Ed CTA URLs for Begin Course and Resume. - Add/adjust unit tests to cover presence/absence of
courseUuidfor both CTAs. - Refactor the Exec Ed tracking-param builder to always return
''for non–Exec Ed courses.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/containers/CourseCard/components/CourseCardActions/ResumeButton.jsx | Adds optional course_id query param for Exec Ed Resume CTA tracking URL. |
| src/containers/CourseCard/components/CourseCardActions/ResumeButton.test.jsx | Updates Resume CTA tests to cover courseUuid present/absent scenarios. |
| src/containers/CourseCard/components/CourseCardActions/BeginCourseButton.jsx | Adds optional course_id query param for Exec Ed Begin Course CTA tracking URL. |
| src/containers/CourseCard/components/CourseCardActions/BeginCourseButton.test.jsx | Updates Begin Course CTA tests and adds coverage for courseUuid present/absent scenarios. |
Suppressed comments (3)
src/containers/CourseCard/components/CourseCardActions/BeginCourseButton.test.jsx:16
- These tests now click the rendered button, but
useCourseTrackingEventis mocked to return an object (not a function). That will be passed asonClickto the ParagonButtonand will throw at runtime when clicked. MockuseCourseTrackingEventto return a function instead.
courseRun: { homeUrl: 'home-url', courseUuid: 'test-course-uuid' },
}),
useCourseTrackingEvent: jest.fn().mockReturnValue({
trackCourseEvent: jest.fn(),
}),
src/containers/CourseCard/components/CourseCardActions/ResumeButton.test.jsx:99
- This test currently clicks the button, but
useCourseTrackingEventis mocked to return a non-function, so clicking will throw. Since the assertion is aboutuseCourseTrackingEventbeing called during render, remove the click/user-event setup and just render before asserting.
render(<IntlProvider locale="en"><ResumeButton {...props} /></IntlProvider>);
const user = userEvent.setup();
const button = screen.getByRole('button', { name: 'Resume' });
user.click(button);
src/containers/CourseCard/components/CourseCardActions/BeginCourseButton.test.jsx:97
- Same as the previous test:
user.click(...)should be awaited to avoid act warnings/flakiness. Make this test async andawait user.click(button).
const user = userEvent.setup();
const button = screen.getByRole('button', { name: 'Begin Course' });
user.click(button);
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
jono-booth
force-pushed
the
jb/exec-ed-course-uuid
branch
from
August 14, 2026 11:00
9824c52 to
d229f17
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BeginCourseButtonandResumeButtonnow append acourse_idquery param (the course's catalog UUID) to the exec-ed tracking param, alongside the existingorg_id:courseUuidcomes fromcourseData.courseRun.courseUuid, which the backend now includes on thecourseRunpayload for Executive Education enrollments only (null/absent otherwise) — no frontend data-layer changes were needed sincecourseRunfields pass throughuseCourseDataunfiltered.This is step 2 of a 3-repo change for ENT-9254 — see "Related ticket" below for the full picture. Titan can use
course_idto identify the presentation and redirect the learner straight into the OLC (Online Learning Campus) instead of stopping on the Titan profile page.Related ticket / issue
Companion changes (separate PRs/repos):
courseUuidto the Learner HomecourseRunAPI payload for Executive Education enrollments — edx/edx-platform#428course_idoff the incoming request and redirects straight to the OLC when it matches a course, instead of rendering the profile pageThis PR is safe to merge independently of the Titan change — it only adds an extra query param to a link Titan already receives (and already reads
org_idoff of); Titan simply ignorescourse_iduntil its side lands.Reviewer guidance
Key files:
src/containers/CourseCard/components/CourseCardActions/BeginCourseButton.jsxsrc/containers/CourseCard/components/CourseCardActions/ResumeButton.jsxSame change duplicated in both files, matching the existing pattern (this logic isn't shared via a hook post the React Query refactor, and this PR isn't the place to introduce that dedup).
To test locally: enroll a test user in a course with an Executive Education mode, load the learner dashboard, and inspect the "Begin/Resume Course" link's href — it should include both
org_idandcourse_id. For a non-ExecEd course, the link should have neither param.Test coverage:
BeginCourseButton.test.jsx/ResumeButton.test.jsxupdated to assertcourse_idis included whencourseUuidis present, and omitted (falls back toorg_idonly) when it isn't.Screenshots
N/A — no UI change, only the destination URL of an existing CTA.
Checklist