mirror of
https://github.com/heyman/heynote.git
synced 2025-01-26 15:59:09 +01:00
Add test that checks that existing keys are kept in buffer files' metadata
This commit is contained in:
parent
1f9be701b3
commit
10b6aa198f
@ -46,3 +46,17 @@ block`)
|
||||
const note = NoteFormat.load(bufferData)
|
||||
expect(note.cursors.ranges.length).toBe(3)
|
||||
})
|
||||
|
||||
test("unknown note metadata keys is kept", async ({ page, browserName }) => {
|
||||
await heynotePage.setContent(`{"yoda":[123], "formatVersion":"1.0", "cursors":{"ranges":[{"anchor":15,"head":15}],"main":0}}
|
||||
∞∞∞text
|
||||
block 1`)
|
||||
await page.locator("body").pressSequentially("hello")
|
||||
expect(await heynotePage.getContent()).toBe(`
|
||||
∞∞∞text
|
||||
block hello1`)
|
||||
|
||||
const bufferData = await heynotePage.getBufferData()
|
||||
const note = NoteFormat.load(bufferData)
|
||||
expect(note.metadata.yoda).toStrictEqual([123])
|
||||
})
|
Loading…
Reference in New Issue
Block a user