Repository navigation
Conversation
|
Shouldn't this use an integration-test, similar to all the existing split/merge tests, rather than a unit-test? See also https://github.com/mozilla/pdf.js/wiki/Squashing-Commits |
5df0b68 to
d96eab4
Compare
|
Thanks for the review. I've moved the regression coverage into the existing The new cases cover deleting one or three trailing pages, restoring the remaining page order, and checking the Save payload. Both fail without the fix and pass with it in Chrome and Firefox. The existing save test, generic build, and lint also pass. |
d96eab4 to
2e7abc0
Compare
2e7abc0 to
808065a
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #21972 +/- ##
==========================================
+ Coverage 90.30% 90.31% +0.01%
==========================================
Files 269 269
Lines 67537 67539 +2
==========================================
+ Hits 60989 60999 +10
+ Misses 6548 6540 -8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Fixes #21971.
After deleting trailing pages and moving the remaining pages back to their original order,
PagesMapperclears the mapping even though the document is shorter. The viewer then treats the document as unchanged and downloads the original PDF, bringing the deleted pages back.Track the original page count and only clear the mapping when both the count and order match the original document.
Add regression coverage to the existing
Reorganize Pages View > Save a pdfintegration suite. The tests delete one or three trailing pages through the sidebar, restore the remaining pages' order, click the main Save button, and verify the saved page selection and order. The original-download path is also captured so the regression fails an assertion instead of timing out.Validation
TESTING=truegeneric build.PagesMapperimplementation, both new tests fail in both browsers because saving takes the original-download path. The existing save test still passes.TESTING=true npx gulp genericandnpx gulp lintpass.The full test suite has not been run locally. The regression tests follow the existing integration-test convention of checking the save payload, since actual saving is disabled in testing builds.