mirror of
https://github.com/heyman/heynote.git
synced 2024-11-25 09:23:17 +01:00
Fix broken tests
This commit is contained in:
parent
2e262241c9
commit
d317ac59a6
@ -1,4 +1,5 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
import { NoteFormat } from '../src/editor/note-format.js';
|
||||
|
||||
export function pageErrorGetter(page) {
|
||||
let messages = [];
|
||||
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user