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.
This commit is contained in:
Tim van der Meij 2025-04-13 14:11:05 +02:00
parent c071f44883
commit 193bebd78a
No known key found for this signature in database
GPG Key ID: 8C3FD2925A5F2762

View File

@ -38,11 +38,11 @@ describe("accessibility", () => {
describe("structure tree", () => { describe("structure tree", () => {
let pages; let pages;
beforeAll(async () => { beforeEach(async () => {
pages = await loadAndWait("structure_simple.pdf", ".structTree"); pages = await loadAndWait("structure_simple.pdf", ".structTree");
}); });
afterAll(async () => { afterEach(async () => {
await closePages(pages); await closePages(pages);
}); });
@ -107,14 +107,14 @@ describe("accessibility", () => {
describe("Annotation", () => { describe("Annotation", () => {
let pages; let pages;
beforeAll(async () => { beforeEach(async () => {
pages = await loadAndWait( pages = await loadAndWait(
"tracemonkey_a11y.pdf", "tracemonkey_a11y.pdf",
".textLayer .endOfContent" ".textLayer .endOfContent"
); );
}); });
afterAll(async () => { afterEach(async () => {
await closePages(pages); await closePages(pages);
}); });
@ -147,11 +147,11 @@ describe("accessibility", () => {
describe("Annotations order", () => { describe("Annotations order", () => {
let pages; let pages;
beforeAll(async () => { beforeEach(async () => {
pages = await loadAndWait("fields_order.pdf", ".annotationLayer"); pages = await loadAndWait("fields_order.pdf", ".annotationLayer");
}); });
afterAll(async () => { afterEach(async () => {
await closePages(pages); await closePages(pages);
}); });
@ -180,11 +180,11 @@ describe("accessibility", () => {
describe("Stamp annotation accessibility", () => { describe("Stamp annotation accessibility", () => {
let pages; let pages;
beforeAll(async () => { beforeEach(async () => {
pages = await loadAndWait("tagged_stamp.pdf", ".annotationLayer"); pages = await loadAndWait("tagged_stamp.pdf", ".annotationLayer");
}); });
afterAll(async () => { afterEach(async () => {
await closePages(pages); await closePages(pages);
}); });
@ -245,11 +245,11 @@ describe("accessibility", () => {
describe("Figure in the content stream", () => { describe("Figure in the content stream", () => {
let pages; let pages;
beforeAll(async () => { beforeEach(async () => {
pages = await loadAndWait("bug1708040.pdf", ".textLayer"); pages = await loadAndWait("bug1708040.pdf", ".textLayer");
}); });
afterAll(async () => { afterEach(async () => {
await closePages(pages); await closePages(pages);
}); });