openpencil/tests/engine/kiwi/serialize-fixes/helpers.ts
Danila Poyarkov 42d346ba47 test(kiwi): split serialization regression coverage
- Move Kiwi serialization fix tests into one file per regression area
- Share codec setup and Kiwi helpers from serialize-fixes/helpers.ts
- Remove serialize fixes from max-lines exceptions
2026-05-06 13:12:53 +03:00

19 lines
499 B
TypeScript

import { beforeAll } from 'bun:test'
import { initCodec, sceneNodeToKiwi, type SceneGraph } from '@open-pencil/core'
beforeAll(async () => {
await initCodec()
})
export function pageId(graph: SceneGraph) {
return graph.getPages()[0].id
}
export const ROOT_GUID = { sessionID: 1, localID: 0 }
export function toKiwi(node: ReturnType<SceneGraph['createNode']>, graph: SceneGraph) {
const blobs: Uint8Array[] = []
return sceneNodeToKiwi(node, ROOT_GUID, 0, { value: 100 }, graph, blobs)
}