Repository navigation
Add a vitest harness for the front-end - #1560
Merged
CarlSchwan merged 1 commit intoSep 8, 2026
Merged
Conversation
The app had no JavaScript tests at all. Vitest runs the specs in "tests/js", "make test" and the "node-test" workflow run it, and the README no longer claims that "make test" runs everything, since the PHP tests need a Nextcloud instance around them. The workflow follows the same shape as the other npm ones in this repository: a "changes" job filtering on paths, the real job gated on it, and a "summary" job that always reports so the check can be a required one without getting stuck pending on a pull request that touches nothing relevant. The specs added here hold on the current code: they check that every viewer parameter the component reads is provided by the template, and that the template still has the same elements as the pdf.js viewer it is a copy of. The regression tests for the individual fixes come with those fixes. Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
This was referenced Sep 7, 2026
CarlSchwan
approved these changes
Sep 8, 2026
Member
|
/backport to stable35 |
Member
|
/backport to stable34 |
Member
|
/backport to stable33 |
This was referenced Sep 8, 2026
Member
|
This already managed to find one regression in pdf.js update PR :) |
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.
The app has no JavaScript tests at all, so nothing under
src/has ever been covered. This adds vitest plus anode-testworkflow that follows the samechanges/summaryshape as the other npm workflows here, so it can be a required check without getting stuck pending on a pull request that touches nothing relevant.The two specs it comes with hold on current master. One checks that every viewer parameter
PDFView.vuereads is actually provided bytemplates/viewer.php; the other that the template still has the same element ids as the pdf.jsviewer.htmlit is a copy of. Thecheck-viewerjob can only tell you thatviewer.htmlchanged, not that the two have drifted apart.I have a handful of small fixes ready that each bring their own regression spec, so this one wants to go in first.
Ran
npm run test,npm run lintandnpm run stylelint.