From 179859f54ad660c9a48c7f9bf099b9df292efb7b Mon Sep 17 00:00:00 2001 From: Tim van der Meij Date: Sun, 13 Apr 2025 14:14:00 +0200 Subject: [PATCH] Isolate the copy/paste 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/copy_paste_spec.mjs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/integration/copy_paste_spec.mjs b/test/integration/copy_paste_spec.mjs index cb5ae3ab9..622d817b1 100644 --- a/test/integration/copy_paste_spec.mjs +++ b/test/integration/copy_paste_spec.mjs @@ -40,12 +40,12 @@ describe("Copy and paste", () => { describe("all text", () => { let pages; - beforeAll(async () => { + beforeEach(async () => { pages = await loadAndWait("tracemonkey.pdf", "#hiddenCopyElement", 100); await mockClipboard(pages); }); - afterAll(async () => { + afterEach(async () => { await closePages(pages); }); @@ -137,7 +137,7 @@ describe("Copy and paste", () => { describe("Copy/paste and ligatures", () => { let pages; - beforeAll(async () => { + beforeEach(async () => { pages = await loadAndWait( "copy_paste_ligatures.pdf", "#hiddenCopyElement", @@ -146,7 +146,7 @@ describe("Copy and paste", () => { await mockClipboard(pages); }); - afterAll(async () => { + afterEach(async () => { await closePages(pages); });