Extend unit-test coverage for the getPdfFilenameFromUrl helper function

Currently there's a couple of branches, specifically for dealing with corrupt URLs, that are not covered by tests.
This commit is contained in:
Jonas Jenwald 2026-05-21 14:03:32 +02:00
parent 5a4d93a238
commit 74471651c7

View File

@ -151,6 +151,9 @@ describe("display_utils", function () {
expect(getPdfFilenameFromUrl("/pdfs/%AA.pdf")).toEqual("%AA.pdf");
expect(getPdfFilenameFromUrl("/pdfs/%2F.pdf")).toEqual("%2F.pdf");
// A corrupt relative URL.
expect(getPdfFilenameFromUrl("//%%file.pdf")).toEqual("document.pdf");
});
it("gets PDF filename from (some) standard protocols", function () {