Scene Graph unit tests move to packages/scene-graph/tests with a package-local assert helper and test type-checking; five Core- and fig-owned tests move to their owners' engine homes. check:test-homes rejects any new test under tests/engine against a reviewed baseline so the migration debt only shrinks.
9 lines
320 B
TypeScript
9 lines
320 B
TypeScript
import type { SceneGraph } from '@open-pencil/scene-graph'
|
|
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
|
|
}
|