From a60f9bc6120dcd8985108b6c0823b45e342e30b4 Mon Sep 17 00:00:00 2001 From: Tim van der Meij Date: Sun, 13 Apr 2025 14:13:12 +0200 Subject: [PATCH] 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. --- test/integration/autolinker_spec.mjs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/integration/autolinker_spec.mjs b/test/integration/autolinker_spec.mjs index a7cbecd29..503f9aed8 100644 --- a/test/integration/autolinker_spec.mjs +++ b/test/integration/autolinker_spec.mjs @@ -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); });