openpencil/tests/engine/scene-graph/basic/helpers.ts
Danila Poyarkov 5e7c042352 test(scene-graph): split basic coverage
- Move scene graph behavior tests into focused files
- Share basic scene graph helper builders from basic/helpers.ts
- Remove scene graph basic from max-lines exceptions
2026-05-06 14:05:58 +03:00

9 lines
313 B
TypeScript

import type { SceneGraph } from '@open-pencil/core'
export function pageId(graph: SceneGraph) {
return graph.getPages()[0].id
}
export function rect(graph: SceneGraph, name: string, x = 0, y = 0, w = 50, h = 50) {
return graph.createNode('RECTANGLE', pageId(graph), { name, x, y, width: w, height: h }).id
}