- 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
19 lines
499 B
TypeScript
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)
|
|
}
|