mirror of
https://github.com/heyman/heynote.git
synced 2024-11-29 03:13:48 +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 { test, expect } from '@playwright/test';
|
||||||
|
import { NoteFormat } from '../src/editor/note-format.js';
|
||||||
|
|
||||||
export function pageErrorGetter(page) {
|
export function pageErrorGetter(page) {
|
||||||
let messages = [];
|
let messages = [];
|
||||||
@ -26,10 +27,15 @@ export class HeynotePage {
|
|||||||
return await this.page.evaluate(() => window._heynote_editor.getBlocks())
|
return await this.page.evaluate(() => window._heynote_editor.getBlocks())
|
||||||
}
|
}
|
||||||
|
|
||||||
async getContent() {
|
async getBufferData() {
|
||||||
return await this.page.evaluate(() => window._heynote_editor.getContent())
|
return await this.page.evaluate(() => window._heynote_editor.getContent())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getContent() {
|
||||||
|
const note = NoteFormat.load(await this.getBufferData())
|
||||||
|
return note.content
|
||||||
|
}
|
||||||
|
|
||||||
async setContent(content) {
|
async setContent(content) {
|
||||||
await expect(this.page.locator("css=.cm-editor")).toBeVisible()
|
await expect(this.page.locator("css=.cm-editor")).toBeVisible()
|
||||||
await this.page.evaluate((content) => window._heynote_editor.setContent(content), content)
|
await this.page.evaluate((content) => window._heynote_editor.setContent(content), content)
|
||||||
|
Loading…
Reference in New Issue
Block a user