Skip to content

Commit

Permalink
add persistence test
Browse files Browse the repository at this point in the history
  • Loading branch information
renardeinside committed Nov 27, 2024
1 parent 2de3735 commit ae53166
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/persistence.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { test, expect } from "./fixtures";
import { loremIpsum } from "lorem-ipsum";

test("make sure that text is persistent between page refreshes", async ({
newtab,
}) => {
const testText = loremIpsum({ count: 1, units: "sentences" });
await newtab.keyboard.type(testText);

// refresh the page
await newtab.reload();

// wait for the text to sync
const input = await newtab.waitForSelector(".ProseMirror");

// check if the text is still there
expect(await input.evaluate((node: any) => node.textContent)).toBe(testText);
});

0 comments on commit ae53166

Please sign in to comment.