Skip to content

Commit

Permalink
Fix broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
heyman committed Jul 15, 2024
1 parent 2e26224 commit d317ac5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/test-utils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { test, expect } from '@playwright/test';
import { NoteFormat } from '../src/editor/note-format.js';

export function pageErrorGetter(page) {
let messages = [];
Expand Down Expand Up @@ -26,10 +27,15 @@ export class HeynotePage {
return await this.page.evaluate(() => window._heynote_editor.getBlocks())
}

async getContent() {
async getBufferData() {
return await this.page.evaluate(() => window._heynote_editor.getContent())
}

async getContent() {
const note = NoteFormat.load(await this.getBufferData())
return note.content
}

async setContent(content) {
await expect(this.page.locator("css=.cm-editor")).toBeVisible()
await this.page.evaluate((content) => window._heynote_editor.setContent(content), content)
Expand Down

0 comments on commit d317ac5

Please sign in to comment.