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

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", () => {
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);
});