Skip to content
File

Blob: tests/e2e/specs/03-share-editable.spec.ts

typescript30 lines
1import { test, expect, createTestPage, createShareLink } from "../fixtures/bland-test";
2 
3test.describe("share link - editable", () => {
4 test("edit-permission share link allows typing", async ({
5 authenticatedPage: { page, accessToken },
6 e2eWorkspace,
7 browser,
8 }) => {
9 // Create a page and an editable share link
10 const testPage = await createTestPage(page, accessToken, "Share Edit Test", e2eWorkspace);
11 const share = await createShareLink(page, accessToken, testPage.pageId, "edit");
12 
13 // Open the share link in a new unauthenticated browser context
14 const anonContext = await browser.newContext();
15 const anonPage = await anonContext.newPage();
16 await anonPage.goto(`/s/${share.token}`);
17 
18 // Wait for the editor to mount in editable mode
19 const editor = anonPage.locator(".tiptap[contenteditable='true']");
20 await editor.waitFor({ timeout: 30_000 });
21 
22 // Type text and verify it appears
23 await editor.click();
24 await anonPage.keyboard.type("Edited via share link");
25 await expect(editor).toContainText("Edited via share link");
26 
27 await anonContext.close();
28 });
29});