From d49d39e84124878c6f7f5511f481ac8ef38d1de1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Trzci=C5=84ski?= Date: Fri, 20 Sep 2024 08:30:06 +0200 Subject: [PATCH] [#66012] Add copy button test --- tests/myst-editor.spec.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/myst-editor.spec.ts b/tests/myst-editor.spec.ts index 9bcfd6b..58dfa9b 100644 --- a/tests/myst-editor.spec.ts +++ b/tests/myst-editor.spec.ts @@ -122,6 +122,13 @@ test.describe.parallel("With collaboration disabled", () => { ) }); }) + + test("Copy as HTML button copies to clipboard", async ({page, context}) => { + await context.grantPermissions(["clipboard-write", "clipboard-read"]); + await page.getByTitle("Copy document as HTML").click(); + const clipboardContent = await page.evaluate(() => navigator.clipboard.readText()); + expect(clipboardContent).toContain("

"); + }); }) test.describe.parallel("With collaboration enabled", () => {