1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 14:48:08 +02:00

Isolate the autolinker integration tests

To avoid being able to introduce dependencies between tests this commit
makes sure that we close the document between tests so that we can't
accidentally rely on state set by a previous test.
This commit is contained in:
Tim van der Meij 2025-04-13 14:13:12 +02:00
parent e1cbba4ded
commit a60f9bc612
No known key found for this signature in database
GPG key ID: 8C3FD2925A5F2762

View file

@ -63,7 +63,7 @@ describe("autolinker", function () {
describe("bug1019475_2.pdf", function () {
let pages;
beforeAll(async () => {
beforeEach(async () => {
pages = await loadAndWait(
"bug1019475_2.pdf",
".annotationLayer",
@ -75,7 +75,7 @@ describe("autolinker", function () {
);
});
afterAll(async () => {
afterEach(async () => {
await closePages(pages);
});
@ -99,7 +99,7 @@ describe("autolinker", function () {
describe("bug1019475_1.pdf", function () {
let pages;
beforeAll(async () => {
beforeEach(async () => {
pages = await loadAndWait(
"bug1019475_1.pdf",
".annotationLayer",
@ -111,7 +111,7 @@ describe("autolinker", function () {
);
});
afterAll(async () => {
afterEach(async () => {
await closePages(pages);
});
@ -138,14 +138,14 @@ describe("autolinker", function () {
describe("pr19449.pdf", function () {
let pages;
beforeAll(async () => {
beforeEach(async () => {
pages = await loadAndWait("pr19449.pdf", ".annotationLayer", null, null, {
docBaseUrl: "http://example.com",
enableAutoLinking: true,
});
});
afterAll(async () => {
afterEach(async () => {
await closePages(pages);
});
@ -172,7 +172,7 @@ describe("autolinker", function () {
describe("PR 19470", function () {
let pages;
beforeAll(async () => {
beforeEach(async () => {
pages = await loadAndWait(
"bug1019475_2.pdf",
".annotationLayer",
@ -184,7 +184,7 @@ describe("autolinker", function () {
);
});
afterAll(async () => {
afterEach(async () => {
await closePages(pages);
});
@ -218,7 +218,7 @@ describe("autolinker", function () {
describe("when highlighting search results", function () {
let pages;
beforeAll(async () => {
beforeEach(async () => {
pages = await loadAndWait(
"issue3115r.pdf",
".annotationLayer",
@ -228,7 +228,7 @@ describe("autolinker", function () {
);
});
afterAll(async () => {
afterEach(async () => {
await closePages(pages);
});