Skip to content

Commit

Permalink
Merge pull request #19457 from timvandermeij/integration-tests-ink-is…
Browse files Browse the repository at this point in the history
…olate

Isolate the ink editor integration tests
  • Loading branch information
timvandermeij authored Feb 9, 2025
2 parents b4a6b1b + 6d9ff34 commit d880355
Showing 1 changed file with 37 additions and 37 deletions.
74 changes: 37 additions & 37 deletions test/integration/ink_editor_spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ describe("Ink Editor", () => {
describe("Basic operations", () => {
let pages;

beforeAll(async () => {
beforeEach(async () => {
pages = await loadAndWait("aboutstacks.pdf", ".annotationEditorLayer");
});

afterAll(async () => {
afterEach(async () => {
await closePages(pages);
});

Expand Down Expand Up @@ -111,7 +111,7 @@ describe("Ink Editor", () => {
it("must draw, undo/redo and check that the editor don't move", async () => {
await Promise.all(
pages.map(async ([browserName, page]) => {
await clearAll(page);
await switchToInk(page);

const rect = await getRect(page, ".annotationEditorLayer");

Expand Down Expand Up @@ -152,11 +152,11 @@ describe("Ink Editor", () => {
describe("with a rotated pdf", () => {
let pages;

beforeAll(async () => {
beforeEach(async () => {
pages = await loadAndWait("issue16278.pdf", ".annotationEditorLayer");
});

afterAll(async () => {
afterEach(async () => {
await closePages(pages);
});

Expand Down Expand Up @@ -191,11 +191,11 @@ describe("Ink Editor", () => {
describe("Invisible layers must be disabled", () => {
let pages;

beforeAll(async () => {
beforeEach(async () => {
pages = await loadAndWait("tracemonkey.pdf", ".annotationEditorLayer");
});

afterAll(async () => {
afterEach(async () => {
await closePages(pages);
});

Expand Down Expand Up @@ -246,11 +246,11 @@ describe("Ink Editor", () => {
describe("Ink editor must be committed when blurred", () => {
let pages;

beforeAll(async () => {
beforeEach(async () => {
pages = await loadAndWait("tracemonkey.pdf", ".annotationEditorLayer");
});

afterAll(async () => {
afterEach(async () => {
await closePages(pages);
});

Expand Down Expand Up @@ -280,11 +280,11 @@ describe("Ink Editor", () => {
describe("Undo a draw", () => {
let pages;

beforeAll(async () => {
beforeEach(async () => {
pages = await loadAndWait("tracemonkey.pdf", ".annotationEditorLayer");
});

afterAll(async () => {
afterEach(async () => {
await closePages(pages);
});

Expand Down Expand Up @@ -324,11 +324,11 @@ describe("Ink Editor", () => {
describe("Delete a draw and undo it on another page", () => {
let pages;

beforeAll(async () => {
beforeEach(async () => {
pages = await loadAndWait("tracemonkey.pdf", ".annotationEditorLayer");
});

afterAll(async () => {
afterEach(async () => {
await closePages(pages);
});

Expand Down Expand Up @@ -381,11 +381,11 @@ describe("Ink Editor", () => {
describe("Delete a draw, scroll and undo it", () => {
let pages;

beforeAll(async () => {
beforeEach(async () => {
pages = await loadAndWait("tracemonkey.pdf", ".annotationEditorLayer");
});

afterAll(async () => {
afterEach(async () => {
await closePages(pages);
});

Expand Down Expand Up @@ -433,11 +433,11 @@ describe("Ink Editor", () => {
describe("Draw several times in the same editor", () => {
let pages;

beforeAll(async () => {
beforeEach(async () => {
pages = await loadAndWait("empty.pdf", ".annotationEditorLayer");
});

afterAll(async () => {
afterEach(async () => {
await closePages(pages);
});

Expand Down Expand Up @@ -469,11 +469,11 @@ describe("Ink Editor", () => {
describe("Drawing must unselect all", () => {
let pages;

beforeAll(async () => {
beforeEach(async () => {
pages = await loadAndWait("empty.pdf", ".annotationEditorLayer");
});

afterAll(async () => {
afterEach(async () => {
await closePages(pages);
});

Expand Down Expand Up @@ -508,11 +508,11 @@ describe("Ink Editor", () => {
describe("Selected editor must be updated even if the page has been destroyed", () => {
let pages;

beforeAll(async () => {
beforeEach(async () => {
pages = await loadAndWait("tracemonkey.pdf", ".annotationEditorLayer");
});

afterAll(async () => {
afterEach(async () => {
await closePages(pages);
});

Expand Down Expand Up @@ -583,11 +583,11 @@ describe("Ink Editor", () => {
describe("Can delete the drawing in progress and undo the deletion", () => {
let pages;

beforeAll(async () => {
beforeEach(async () => {
pages = await loadAndWait("empty.pdf", ".annotationEditorLayer");
});

afterAll(async () => {
afterEach(async () => {
await closePages(pages);
});

Expand Down Expand Up @@ -627,11 +627,11 @@ describe("Ink Editor", () => {
describe("Annotation mustn't take focus if it isn't visible", () => {
let pages;

beforeAll(async () => {
beforeEach(async () => {
pages = await loadAndWait("tracemonkey.pdf", ".annotationEditorLayer");
});

afterAll(async () => {
afterEach(async () => {
await closePages(pages);
});

Expand Down Expand Up @@ -684,11 +684,11 @@ describe("Ink Editor", () => {
describe("Ink (update existing)", () => {
let pages;

beforeAll(async () => {
beforeEach(async () => {
pages = await loadAndWait("inks.pdf", ".annotationEditorLayer");
});

afterAll(async () => {
afterEach(async () => {
await closePages(pages);
});

Expand Down Expand Up @@ -785,11 +785,11 @@ describe("Ink Editor", () => {
describe("Ink (move existing)", () => {
let pages;

beforeAll(async () => {
beforeEach(async () => {
pages = await loadAndWait("inks.pdf", getAnnotationSelector("277R"));
});

afterAll(async () => {
afterEach(async () => {
await closePages(pages);
});

Expand Down Expand Up @@ -953,11 +953,11 @@ describe("Ink Editor", () => {
describe("Ink must update its stroke width when not the current active layer", () => {
let pages;

beforeAll(async () => {
beforeEach(async () => {
pages = await loadAndWait("tracemonkey.pdf", ".annotationEditorLayer");
});

afterAll(async () => {
afterEach(async () => {
await closePages(pages);
});

Expand Down Expand Up @@ -1015,15 +1015,15 @@ describe("Ink Editor", () => {
describe("Draw annotations on several page, move one of them and delete it", () => {
let pages;

beforeAll(async () => {
beforeEach(async () => {
pages = await loadAndWait(
"tracemonkey.pdf",
".annotationEditorLayer",
10
);
});

afterAll(async () => {
afterEach(async () => {
await closePages(pages);
});

Expand Down Expand Up @@ -1079,11 +1079,11 @@ describe("Ink Editor", () => {
describe("Page position should remain unchanged after drawing", () => {
let pages;

beforeAll(async () => {
beforeEach(async () => {
pages = await loadAndWait("tracemonkey.pdf", ".annotationEditorLayer");
});

afterAll(async () => {
afterEach(async () => {
await closePages(pages);
});

Expand Down Expand Up @@ -1130,11 +1130,11 @@ describe("Ink Editor", () => {
describe("The pen-drawn shape must maintain correct curvature regardless of the page it is drawn on or whether the curve's endpoint lies within or beyond the page boundaries", () => {
let pages;

beforeAll(async () => {
beforeEach(async () => {
pages = await loadAndWait("tracemonkey.pdf", ".annotationEditorLayer");
});

afterAll(async () => {
afterEach(async () => {
await closePages(pages);
});

Expand Down

0 comments on commit d880355

Please sign in to comment.