openedx / frontend-app-learning

Front-end for the Open edX course experience, implemented using React and Paragon.
GNU Affero General Public License v3.0
46 stars 207 forks source link

fix: xblock error mfe unit preview #1508

Closed KristinAoki closed 3 weeks ago

KristinAoki commented 3 weeks ago

Description

This PR fixes xblock not showing the preview when a course staff member is masquerading as another user/course track. Additionally this PR fixes navigation between units that have never been published and units that have been published with or without edits.

Testing

Testing view for different course tracks

  1. Open a course in Studio
  2. Publish an existing unit
  3. Make a change to the unit so that it is showing a draft version in Studio
  4. Click "View live"
  5. Confirm that the published version of unit is visible
  6. Confirm that preview is not in the URL
  7. Go back to the Studio page
  8. Click "Preview"
  9. Confirm that the draft version of the unit is visible
  10. Confirm that "preview" is at the beginning of the URL

Repeat steps above when masquerading as a verified learner and audit learner. Confirm that the preview is displayed as expected for each track.

Testing for unit navigation

  1. In Studio add a new unit with any block
  2. Click preview
  3. Confirm that the unit is visible
  4. Confirm that the sequence navigation has the correct number of buttons for the number of units
  5. Click "Previous" and confirm the correct unit is loaded
  6. Click icon for the draft unit in the sequence navigation
  7. Confirm that the draft loads
  8. Click "Next" confirm that the next unit/sequence is loaded

Other information

This PR is dependent on edx-platform PR #35747

codecov[bot] commented 3 weeks ago

Codecov Report

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

Project coverage is 89.23%. Comparing base (2d63a14) to head (4c9143b). Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
src/index.jsx 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1508 +/- ## ========================================== - Coverage 89.24% 89.23% -0.01% ========================================== Files 316 317 +1 Lines 5549 5557 +8 Branches 1369 1341 -28 ========================================== + Hits 4952 4959 +7 - Misses 581 583 +2 + Partials 16 15 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.