From 193bebd78a24e9cbbd43426c5bb8a7973b8481f8 Mon Sep 17 00:00:00 2001 From: Tim van der Meij Date: Sun, 13 Apr 2025 14:11:05 +0200 Subject: [PATCH] Isolate the accessibility 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/accessibility_spec.mjs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/integration/accessibility_spec.mjs b/test/integration/accessibility_spec.mjs index ad07e43fd..fa8f1d5ab 100644 --- a/test/integration/accessibility_spec.mjs +++ b/test/integration/accessibility_spec.mjs @@ -38,11 +38,11 @@ describe("accessibility", () => { describe("structure tree", () => { let pages; - beforeAll(async () => { + beforeEach(async () => { pages = await loadAndWait("structure_simple.pdf", ".structTree"); }); - afterAll(async () => { + afterEach(async () => { await closePages(pages); }); @@ -107,14 +107,14 @@ describe("accessibility", () => { describe("Annotation", () => { let pages; - beforeAll(async () => { + beforeEach(async () => { pages = await loadAndWait( "tracemonkey_a11y.pdf", ".textLayer .endOfContent" ); }); - afterAll(async () => { + afterEach(async () => { await closePages(pages); }); @@ -147,11 +147,11 @@ describe("accessibility", () => { describe("Annotations order", () => { let pages; - beforeAll(async () => { + beforeEach(async () => { pages = await loadAndWait("fields_order.pdf", ".annotationLayer"); }); - afterAll(async () => { + afterEach(async () => { await closePages(pages); }); @@ -180,11 +180,11 @@ describe("accessibility", () => { describe("Stamp annotation accessibility", () => { let pages; - beforeAll(async () => { + beforeEach(async () => { pages = await loadAndWait("tagged_stamp.pdf", ".annotationLayer"); }); - afterAll(async () => { + afterEach(async () => { await closePages(pages); }); @@ -245,11 +245,11 @@ describe("accessibility", () => { describe("Figure in the content stream", () => { let pages; - beforeAll(async () => { + beforeEach(async () => { pages = await loadAndWait("bug1708040.pdf", ".textLayer"); }); - afterAll(async () => { + afterEach(async () => { await closePages(pages); });