Skip to content

Commit

Permalink
Add test that checks that existing keys are kept in buffer files' met…
Browse files Browse the repository at this point in the history
…adata
  • Loading branch information
heyman committed Jul 16, 2024
1 parent 86243f4 commit 8f39b66
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/note-format.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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])
})

0 comments on commit 8f39b66

Please sign in to comment.