1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Merge pull request #17161 from Snuffleupagus/NullL10n-test

Add a unit-test to ensure that `NullL10n` won't diverge from the `L10n`-class
This commit is contained in:
Jonas Jenwald 2023-10-24 20:28:34 +02:00 committed by GitHub
commit f098121644
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 6 deletions

View file

@ -30,6 +30,7 @@ import { AnnotationLayerBuilder } from "../../web/annotation_layer_builder.js";
import { DownloadManager } from "../../web/download_manager.js";
import { EventBus } from "../../web/event_utils.js";
import { GenericL10n } from "../../web/genericl10n.js";
import { L10n } from "../../web/l10n.js";
import { NullL10n } from "../../web/l10n_utils.js";
import { PDFHistory } from "../../web/pdf_history.js";
import { PDFPageView } from "../../web/pdf_page_view.js";
@ -72,4 +73,14 @@ describe("pdfviewer_api", function () {
XfaLayerBuilder,
});
});
it("checks that `NullL10n` implements all methods", function () {
const methods = Object.getOwnPropertyNames(NullL10n).sort();
const baseMethods = Object.getOwnPropertyNames(L10n.prototype)
.filter(m => m !== "constructor" && !m.startsWith("_"))
.sort();
expect(methods).toEqual(baseMethods);
});
});