Skip to content

feat: handle proctoring-blocked certificates - #58

Merged
santhosh-apphelix-2u merged 7 commits into
release-teakfrom
feature/lp-592-certificate-proctoring-review-block
Sep 14, 2026
Merged

santhosh-apphelix-2u merged 7 commits into
release-teakfrom
feature/lp-592-certificate-proctoring-review-block

Conversation

@santhosh-apphelix-2u

@santhosh-apphelix-2u santhosh-apphelix-2u commented Sep 11, 2026

Copy link
Copy Markdown

Summary

Update the Learning MFE to correctly handle certificates blocked by proctoring status.
Ticket - LP-592

Changes

  • Hide certificate view and download actions while access is blocked.
  • Hide LinkedIn certificate-sharing actions while blocked.
  • Add messages for review-pending, incomplete, not-attempted, and unavailable proctoring states.
  • Update Progress, Outline, and Course Exit certificate flows.
  • Update frontend tests, factories, and Pact fixtures.

Copilot AI and others added 2 commits September 11, 2026 04:12
Co-authored-by: santhosh-apphelix-2u <211942388+santhosh-apphelix-2u@users.noreply.github.com>
Co-authored-by: santhosh-apphelix-2u <211942388+santhosh-apphelix-2u@users.noreply.github.com>
@santhosh-apphelix-2u
santhosh-apphelix-2u marked this pull request as ready for review September 14, 2026 09:56
Copilot AI lite review requested due to automatic review settings September 14, 2026 09:56
@santhosh-apphelix-2u
santhosh-apphelix-2u merged commit fd2c1e5 into release-teak Sep 14, 2026
4 checks passed
@santhosh-apphelix-2u
santhosh-apphelix-2u deleted the feature/lp-592-certificate-proctoring-review-block branch September 14, 2026 09:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The Pact expectation omits newly added fields, and several proctoring branches lack test coverage.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds proctoring-aware handling for blocked certificates across Course Exit, Progress, and Outline flows.

Changes:

  • Hides certificate and LinkedIn actions when access is blocked.
  • Adds messages for proctoring states.
  • Updates Pact data, factories, snapshots, and tests.

Open items include updating the Pact expected normalized metadata and covering incomplete, not-attempted, and unavailable reason codes.

File summaries
File Summary
src/pacts/frontend-app-learning-lms.json Updates certificate contract fields.
src/courseware/data/pact-tests/lmsPact.test.jsx Updates Pact data; expected normalized fields need completion.
src/courseware/course/course-exit/messages.ts Adds blocked-certificate messages.
src/courseware/course/course-exit/CourseExit.test.jsx Tests blocked certificate behavior.
src/courseware/course/course-exit/CourseCelebration.jsx Hides blocked certificate actions and shows messaging.
src/course-home/progress-tab/ProgressTab.test.jsx Tests Progress certificate handling.
src/course-home/progress-tab/certificate-status/messages.ts Adds proctoring message mappings.
src/course-home/progress-tab/certificate-status/CertificateStatus.jsx Handles blocked Progress certificates.
src/course-home/outline-tab/OutlineTab.test.jsx Tests Outline certificate alerts.
src/course-home/outline-tab/alerts/certificate-status-alert/hooks.js Passes certificate blocking metadata.
src/course-home/outline-tab/alerts/certificate-status-alert/CertificateStatusAlert.jsx Renders blocked-certificate alerts.
src/course-home/data/__snapshots__/redux.test.js.snap Updates normalized data snapshots.
src/course-home/data/__factories__/outlineTabData.factory.js Adds blocking fields to test data.
Review details

Suppressed comments (2)

src/course-home/progress-tab/ProgressTab.test.jsx:1121

  • The added coverage only exercises proctoring_review_pending, while the new mapping also has distinct proctored_exam_not_attempted, proctored_exam_incomplete, and fallback/unavailable branches. Add cases for those reasons (and assert the certificate action remains hidden) so the user-facing states promised by this change are protected from regressions.
      it('Displays proctoring block message without certificate action', async () => {
        setTabData({
          certificate_data: {
            cert_status: 'downloadable',
            certificate_blocked_due_to_proctoring: true,
            certificate_block_reason: 'proctoring_review_pending',
            certificate_blocking_statuses: ['submitted'],
          },
          user_has_passing_grade: true,
        });
        await fetchAndRender();

        expect(screen.getByText('Certificate temporarily unavailable')).toBeInTheDocument();
        expect(screen.getByText(/being reviewed/)).toBeInTheDocument();
        expect(screen.queryByRole('link', { name: 'View my certificate' })).not.toBeInTheDocument();
        expect(screen.queryByRole('button', { name: 'View my certificate' })).not.toBeInTheDocument();
      });

src/course-home/progress-tab/certificate-status/messages.ts:133

  • The new mapping has separate behavior for review-pending, incomplete/not-attempted, and the unavailable fallback, but the added UI tests exercise only proctoring_review_pending. A typo in either explicit reason code or the fallback message would therefore go undetected; add cases for proctored_exam_incomplete, proctored_exam_not_attempted, and an unknown/unavailable reason (ideally as a table-driven test for the shared helper).
export const getProctoringBlockedMessage = (reason) => {
  if (reason === 'proctoring_review_pending') {
    return messages.proctoringReviewPendingBody;
  }
  if (reason === 'proctored_exam_not_attempted' || reason === 'proctored_exam_incomplete') {
    return messages.proctoringIncompleteBody;
  }
  return messages.proctoringUnavailableBody;
  • Files reviewed: 13/13 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +332 to +334
certificate_blocked_due_to_proctoring: boolean(false),
certificate_block_reason: null,
certificate_blocking_statuses: [],
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.

5 participants