Skip to content

AI-native design editor. Open-source Figma alternative.

test(core): move the editor suite into the package (#792)

Danila Poyarkov87bff8620cb5
diff --git a/bun.lock b/bun.lock
index 03262c0f9..13eda55cc 100644
--- a/bun.lock
+++ b/bun.lock
@@ -223,6 +223,7 @@
"yoga-layout": "npm:@open-pencil/[email protected]",
},
"devDependencies": {
+ "@types/bun": "^1.3.14",
"@types/culori": "^4.0.1",
"@types/diff": "^8.0.0",
"@types/opentype.js": "^1.3.10",
diff --git a/packages/core/package.json b/packages/core/package.json
index b4429fe5e..3d21554f5 100644
--- a/packages/core/package.json
+++ b/packages/core/package.json
@@ -164,7 +164,9 @@
},
"scripts": {
"build": "bunx tsdown --config tsdown.config.ts",
- "prepublishOnly": "bun run build"
+ "prepublishOnly": "bun run build",
+ "test": "bun test tests",
+ "typecheck": "bunx tsgo --noEmit -p tsconfig.test.json"
},
"dependencies": {
"@chenglou/pretext": "^0.0.7",
@@ -205,6 +207,7 @@
"yoga-layout": "npm:@open-pencil/[email protected]"
},
"devDependencies": {
+ "@types/bun": "^1.3.14",
"@types/culori": "^4.0.1",
"@types/diff": "^8.0.0",
"@types/opentype.js": "^1.3.10",
diff --git a/packages/core/src/editor/graph-events.ts b/packages/core/src/editor/graph-events.ts
index a8a93e582..f34fdecbb 100644
--- a/packages/core/src/editor/graph-events.ts
+++ b/packages/core/src/editor/graph-events.ts
@@ -4,9 +4,17 @@ import type { SkiaRenderer } from '#core/canvas/renderer'
type EmittedGraphEventName = keyof SceneGraphEvents
+/** The renderer surface graph events invalidate; tests provide a double of just this. */
+export type GraphEventRenderer = Pick<
+ SkiaRenderer,
+ 'invalidateVectorPath' | 'invalidateNodePicture'
+> & {
+ tiledScene: Pick<SkiaRenderer['tiledScene'], 'invalidateNode' | 'invalidateStructure'>
+}
+
type GraphEventOptions = {
getGraph: () => SceneGraph
- getRenderers: () => Iterable<SkiaRenderer>
+ getRenderers: () => Iterable<GraphEventRenderer>
scheduleComponentSync: (nodeId: string) => void
requestRender: () => void
emitEditorEvent: <K extends EmittedGraphEventName>(
@@ -56,7 +64,7 @@ export function rendererInvalidationForChanges(
function invalidateRenderersForChange(
graph: SceneGraph,
- renderers: Iterable<SkiaRenderer>,
+ renderers: Iterable<GraphEventRenderer>,
id: string,
changes: Partial<SceneNode>,
invalidateNodePicture: boolean
diff --git a/tests/engine/editor/clipboard/binding-corruption.test.ts b/packages/core/tests/editor/clipboard/binding-corruption.test.ts
similarity index 89%
rename from tests/engine/editor/clipboard/binding-corruption.test.ts
rename to packages/core/tests/editor/clipboard/binding-corruption.test.ts
index 5be789ea0..222cbd0be 100644
--- a/tests/engine/editor/clipboard/binding-corruption.test.ts
+++ b/packages/core/tests/editor/clipboard/binding-corruption.test.ts
@@ -4,6 +4,8 @@ import { SceneGraph } from '@open-pencil/core'
import { collectSubtrees } from '@open-pencil/core/editor/clipboard/subtree-history'
import { createInstanceOverrideState } from '@open-pencil/scene-graph'
+import { expectDefined, getNodeOrThrow } from '../../helpers/assert'
+
function pageId(graph: SceneGraph): string {
return graph.getPages()[0].id
}
@@ -40,7 +42,7 @@ describe('cloneTree deep-copies boundVariables, overrides, and styleRuns', () =>
fills: [{ type: 'SOLID', color: { r: 0.1, g: 0.1, b: 0.1, a: 1 }, visible: true, opacity: 1 }]
})
graph.bindVariable(node.id, 'fills/0/color', 'v1')
- const original = graph.getNode(node.id)
+ const original = getNodeOrThrow(graph, node.id)
const clone =
graph.cloneTree(node.id, pageId(graph)) ??
@@ -59,7 +61,7 @@ describe('cloneTree deep-copies boundVariables, overrides, and styleRuns', () =>
fills: [{ type: 'SOLID', color: { r: 0.1, g: 0.1, b: 0.1, a: 1 }, visible: true, opacity: 1 }]
})
graph.bindVariable(node.id, 'fills/0/color', 'v1')
- const original = graph.getNode(node.id)
+ const original = getNodeOrThrow(graph, node.id)
const clone =
graph.cloneTree(node.id, pageId(graph)) ??
@@ -80,7 +82,7 @@ describe('cloneTree deep-copies boundVariables, overrides, and styleRuns', () =>
name: 'Original',
instanceOverrides: createInstanceOverrideState()
})
- const original = graph.getNode(node.id)
+ const original = getNodeOrThrow(graph, node.id)
const clone =
graph.cloneTree(node.id, pageId(graph)) ??
@@ -99,7 +101,7 @@ describe('cloneTree deep-copies boundVariables, overrides, and styleRuns', () =>
fontFamily: 'Inter',
styleRuns: [{ start: 0, length: 5, style: { fontWeight: 700 } }]
})
- const original = graph.getNode(node.id)
+ const original = getNodeOrThrow(graph, node.id)
const clone =
graph.cloneTree(node.id, pageId(graph)) ??
@@ -119,7 +121,7 @@ describe('cloneTree deep-copies boundVariables, overrides, and styleRuns', () =>
name: 'Original',
fills: [{ type: 'SOLID', color: { r: 1, g: 0, b: 0, a: 1 }, visible: true, opacity: 1 }]
})
- const original = graph.getNode(node.id)
+ const original = getNodeOrThrow(graph, node.id)
const clone =
graph.cloneTree(node.id, pageId(graph)) ??
@@ -188,7 +190,7 @@ describe('instance child bindings are independent from component', () => {
})
graph.bindVariable(child.id, 'fills/0/color', 'v1')
- const compChild = graph.getNode(child.id)
+ const compChild = getNodeOrThrow(graph, child.id)
const instance =
graph.createInstance(component.id, page) ??
@@ -221,7 +223,7 @@ describe('instance child bindings are independent from component', () => {
height: 40
})
- const compChild = graph.getNode(child.id)
+ const compChild = getNodeOrThrow(graph, child.id)
const instance =
graph.createInstance(component.id, page) ??
@@ -251,7 +253,7 @@ describe('instance child bindings are independent from component', () => {
// Set source.fig on component child
graph.updateNode(child.id, {
source: {
- ...graph.getNode(child.id).source,
+ ...getNodeOrThrow(graph, child.id).source,
format: 'fig',
fig: {
rawSize: { x: 100, y: 40 },
@@ -267,7 +269,7 @@ describe('instance child bindings are independent from component', () => {
}
})
- const compChild = graph.getNode(child.id)
+ const compChild = getNodeOrThrow(graph, child.id)
const instance =
graph.createInstance(component.id, page) ??
(() => {
@@ -302,7 +304,7 @@ describe('set_fill/set_stroke clean up stale bindings', () => {
graph.bindVariable(node.id, 'fills/0/color', 'v1')
graph.bindVariable(node.id, 'fills/1/color', 'v2')
- const n = graph.getNode(node.id)
+ const n = getNodeOrThrow(graph, node.id)
expect(n.boundVariables['fills/0/color']).toBe('v1')
expect(n.boundVariables['fills/1/color']).toBe('v2')
@@ -316,7 +318,7 @@ describe('set_fill/set_stroke clean up stale bindings', () => {
test('set_fill removes top-level fills binding (dead data)', () => {
const graph = new SceneGraph()
const node = graph.createNode('RECTANGLE', pageId(graph), { name: 'Rect' })
- const n = graph.getNode(node.id)
+ const n = getNodeOrThrow(graph, node.id)
// Set a top-level 'fills' binding (dead data — renderer never reads this)
n.boundVariables['fills'] = 'v1'
@@ -342,7 +344,7 @@ describe('collectSubtrees deep-copies nodes', () => {
fills: [{ type: 'SOLID', color: { r: 0.1, g: 0.1, b: 0.1, a: 1 }, visible: true, opacity: 1 }]
})
graph.bindVariable(node.id, 'fills/0/color', 'v1')
- const original = graph.getNode(node.id)
+ const original = getNodeOrThrow(graph, node.id)
const collected = collectSubtrees(graph, [node.id])
expect(collected.length).toBe(1)
@@ -361,11 +363,11 @@ describe('undo of binding on clone restores original state', () => {
fills: [{ type: 'SOLID', color: { r: 0.1, g: 0.1, b: 0.1, a: 1 }, visible: true, opacity: 1 }]
})
graph.bindVariable(node.id, 'fills/0/color', 'v1')
- const clone = graph.cloneTree(node.id, pageId(graph))
+ const clone = expectDefined(graph.cloneTree(node.id, pageId(graph)), 'clone')
graph.bindVariable(clone.id, 'fills/0/color', 'v2')
- expect(graph.getNode(clone.id).boundVariables['fills/0/color']).toBe('v2')
+ expect(getNodeOrThrow(graph, clone.id).boundVariables['fills/0/color']).toBe('v2')
// Original should be unaffected
- expect(graph.getNode(node.id).boundVariables['fills/0/color']).toBe('v1')
+ expect(getNodeOrThrow(graph, node.id).boundVariables['fills/0/color']).toBe('v1')
})
})
@@ -380,16 +382,16 @@ describe('variable deletion and re-clone safety', () => {
fills: [{ type: 'SOLID', color: { r: 0.1, g: 0.1, b: 0.1, a: 1 }, visible: true, opacity: 1 }]
})
graph.bindVariable(node.id, 'fills/0/color', 'v1')
- const clone1 = graph.cloneTree(node.id, pageId(graph))
- expect(graph.getNode(clone1.id).boundVariables['fills/0/color']).toBe('v1')
+ const clone1 = expectDefined(graph.cloneTree(node.id, pageId(graph)), 'clone')
+ expect(getNodeOrThrow(graph, clone1.id).boundVariables['fills/0/color']).toBe('v1')
// Delete the variable — this cleans up bindings on all nodes
graph.removeVariable('v1')
// Bindings are removed from both original and clone
- expect(graph.getNode(node.id).boundVariables['fills/0/color']).toBeUndefined()
- expect(graph.getNode(clone1.id).boundVariables['fills/0/color']).toBeUndefined()
+ expect(getNodeOrThrow(graph, node.id).boundVariables['fills/0/color']).toBeUndefined()
+ expect(getNodeOrThrow(graph, clone1.id).boundVariables['fills/0/color']).toBeUndefined()
// Clone again — should not crash, clone has no stale binding
- const clone2 = graph.cloneTree(node.id, pageId(graph))
+ const clone2 = expectDefined(graph.cloneTree(node.id, pageId(graph)), 'clone')
expect(clone2).toBeDefined()
- expect(graph.getNode(clone2.id).boundVariables['fills/0/color']).toBeUndefined()
+ expect(getNodeOrThrow(graph, clone2.id).boundVariables['fills/0/color']).toBeUndefined()
})
})
diff --git a/tests/engine/editor/clipboard/delete.test.ts b/packages/core/tests/editor/clipboard/delete.test.ts
similarity index 89%
rename from tests/engine/editor/clipboard/delete.test.ts
rename to packages/core/tests/editor/clipboard/delete.test.ts
index 7c434190b..0fb72e5b8 100644
--- a/tests/engine/editor/clipboard/delete.test.ts
+++ b/packages/core/tests/editor/clipboard/delete.test.ts
@@ -3,8 +3,8 @@ import { describe, expect, test } from 'bun:test'
import { createEditor } from '@open-pencil/core/editor'
import { computeAllLayouts } from '@open-pencil/core/layout'
-import { getNodeOrThrow } from '#tests/helpers/assert'
-import { autoFrame, rect } from '#tests/helpers/layout'
+import { getNodeOrThrow } from '../../helpers/assert'
+import { autoFrame, rect } from '../../helpers/layout'
describe('deleteSelected', () => {
test('reflows fixed vertical auto-layout siblings', () => {
diff --git a/tests/engine/editor/clipboard/figma-images.test.ts b/packages/core/tests/editor/clipboard/figma-images.test.ts
similarity index 98%
rename from tests/engine/editor/clipboard/figma-images.test.ts
rename to packages/core/tests/editor/clipboard/figma-images.test.ts
index 74205e989..e6f6c0dfa 100644
--- a/tests/engine/editor/clipboard/figma-images.test.ts
+++ b/packages/core/tests/editor/clipboard/figma-images.test.ts
@@ -5,7 +5,7 @@ import { buildFigmaClipboardHTML } from '@open-pencil/core/clipboard'
import { createEditor } from '@open-pencil/core/editor'
import type { ClipboardImageResolution } from '@open-pencil/core/editor'
-import { expectDefined } from '#tests/helpers/assert'
+import { expectDefined } from '../../helpers/assert'
const IMAGE_HASH_A = '1111111111111111111111111111111111111111'
const IMAGE_HASH_B = '2222222222222222222222222222222222222222'
diff --git a/tests/engine/editor/clipboard/file-placement.test.ts b/packages/core/tests/editor/clipboard/file-placement.test.ts
similarity index 100%
rename from tests/engine/editor/clipboard/file-placement.test.ts
rename to packages/core/tests/editor/clipboard/file-placement.test.ts
diff --git a/tests/engine/editor/clipboard/import-nodes/components.test.ts b/packages/core/tests/editor/clipboard/import-nodes/components.test.ts
similarity index 98%
rename from tests/engine/editor/clipboard/import-nodes/components.test.ts
rename to packages/core/tests/editor/clipboard/import-nodes/components.test.ts
index 18cadacb7..aebd84d10 100644
--- a/tests/engine/editor/clipboard/import-nodes/components.test.ts
+++ b/packages/core/tests/editor/clipboard/import-nodes/components.test.ts
@@ -3,8 +3,8 @@ import { describe, expect, it } from 'bun:test'
import { importClipboardNodes } from '@open-pencil/core'
import type { NodeChange } from '@open-pencil/core'
-import { getNodeOrThrow } from '#tests/helpers/assert'
-import { createClipboardGraph } from '#tests/helpers/clipboard'
+import { getNodeOrThrow } from '../../../helpers/assert'
+import { createClipboardGraph } from '../../../helpers/clipboard'
describe('importClipboardNodes: components', () => {
it('maps SYMBOL type to COMPONENT with auto-layout', () => {
diff --git a/tests/engine/editor/clipboard/import-nodes/filtering.test.ts b/packages/core/tests/editor/clipboard/import-nodes/filtering.test.ts
similarity index 96%
rename from tests/engine/editor/clipboard/import-nodes/filtering.test.ts
rename to packages/core/tests/editor/clipboard/import-nodes/filtering.test.ts
index 5e1e1287e..9b257228d 100644
--- a/tests/engine/editor/clipboard/import-nodes/filtering.test.ts
+++ b/packages/core/tests/editor/clipboard/import-nodes/filtering.test.ts
@@ -3,8 +3,8 @@ import { describe, expect, it } from 'bun:test'
import { importClipboardNodes } from '@open-pencil/core'
import type { NodeChange } from '@open-pencil/core'
-import { getNodeOrThrow } from '#tests/helpers/assert'
-import { createClipboardGraph } from '#tests/helpers/clipboard'
+import { getNodeOrThrow } from '../../../helpers/assert'
+import { createClipboardGraph } from '../../../helpers/clipboard'
describe('importClipboardNodes: filtering', () => {
it('skips VARIABLE_SET and VARIABLE nodes', () => {
diff --git a/tests/engine/editor/clipboard/import-nodes/hierarchy.test.ts b/packages/core/tests/editor/clipboard/import-nodes/hierarchy.test.ts
similarity index 97%
rename from tests/engine/editor/clipboard/import-nodes/hierarchy.test.ts
rename to packages/core/tests/editor/clipboard/import-nodes/hierarchy.test.ts
index e957f8ed5..650e3c721 100644
--- a/tests/engine/editor/clipboard/import-nodes/hierarchy.test.ts
+++ b/packages/core/tests/editor/clipboard/import-nodes/hierarchy.test.ts
@@ -3,8 +3,8 @@ import { describe, expect, it } from 'bun:test'
import { importClipboardNodes } from '@open-pencil/core'
import type { NodeChange } from '@open-pencil/core'
-import { getNodeOrThrow } from '#tests/helpers/assert'
-import { createClipboardGraph } from '#tests/helpers/clipboard'
+import { getNodeOrThrow } from '../../../helpers/assert'
+import { createClipboardGraph } from '../../../helpers/clipboard'
describe('importClipboardNodes: hierarchy', () => {
it('imports nested frames with children', () => {
diff --git a/tests/engine/editor/clipboard/import-nodes/instance-linkage.test.ts b/packages/core/tests/editor/clipboard/import-nodes/instance-linkage.test.ts
similarity index 99%
rename from tests/engine/editor/clipboard/import-nodes/instance-linkage.test.ts
rename to packages/core/tests/editor/clipboard/import-nodes/instance-linkage.test.ts
index 6ad23cd15..ee6e09472 100644
--- a/tests/engine/editor/clipboard/import-nodes/instance-linkage.test.ts
+++ b/packages/core/tests/editor/clipboard/import-nodes/instance-linkage.test.ts
@@ -5,7 +5,7 @@ import type { NodeChange } from '@open-pencil/core'
import { linkImportedInstanceChildren } from '@open-pencil/fig/node-change'
import { SceneGraph } from '@open-pencil/scene-graph'
-import { getNodeOrThrow } from '#tests/helpers/assert'
+import { getNodeOrThrow } from '../../../helpers/assert'
describe('importClipboardNodes: instance child linkage', () => {
it('links serialized instance children so a later component sync does not duplicate them', () => {
diff --git a/tests/engine/editor/clipboard/import-nodes/paste-scope.test.ts b/packages/core/tests/editor/clipboard/import-nodes/paste-scope.test.ts
similarity index 100%
rename from tests/engine/editor/clipboard/import-nodes/paste-scope.test.ts
rename to packages/core/tests/editor/clipboard/import-nodes/paste-scope.test.ts
diff --git a/tests/engine/editor/clipboard/import-nodes/styling.test.ts b/packages/core/tests/editor/clipboard/import-nodes/styling.test.ts
similarity index 92%
rename from tests/engine/editor/clipboard/import-nodes/styling.test.ts
rename to packages/core/tests/editor/clipboard/import-nodes/styling.test.ts
index 0407f377b..699088cfd 100644
--- a/tests/engine/editor/clipboard/import-nodes/styling.test.ts
+++ b/packages/core/tests/editor/clipboard/import-nodes/styling.test.ts
@@ -3,8 +3,8 @@ import { describe, expect, it } from 'bun:test'
import { importClipboardNodes } from '@open-pencil/core'
import type { NodeChange } from '@open-pencil/core'
-import { getNodeOrThrow } from '#tests/helpers/assert'
-import { createClipboardGraph } from '#tests/helpers/clipboard'
+import { getNodeOrThrow } from '../../../helpers/assert'
+import { createClipboardGraph } from '../../../helpers/clipboard'
describe('importClipboardNodes: styling', () => {
it('preserves fills and strokes', () => {
diff --git a/tests/engine/editor/clipboard/import-nodes/text/metrics.test.ts b/packages/core/tests/editor/clipboard/import-nodes/text/metrics.test.ts
similarity index 98%
rename from tests/engine/editor/clipboard/import-nodes/text/metrics.test.ts
rename to packages/core/tests/editor/clipboard/import-nodes/text/metrics.test.ts
index cc3e36011..b9bcb5ae7 100644
--- a/tests/engine/editor/clipboard/import-nodes/text/metrics.test.ts
+++ b/packages/core/tests/editor/clipboard/import-nodes/text/metrics.test.ts
@@ -3,8 +3,8 @@ import { describe, expect, it } from 'bun:test'
import { importClipboardNodes } from '@open-pencil/core'
import type { NodeChange } from '@open-pencil/core'
-import { getNodeOrThrow } from '#tests/helpers/assert'
-import { createClipboardGraph } from '#tests/helpers/clipboard'
+import { getNodeOrThrow } from '../../../../helpers/assert'
+import { createClipboardGraph } from '../../../../helpers/clipboard'
describe('importClipboardNodes: text metrics', () => {
it('imports fontWeight from fontName.style via styleToWeight', () => {
diff --git a/tests/engine/editor/clipboard/import-nodes/undo/redo.test.ts b/packages/core/tests/editor/clipboard/import-nodes/undo/redo.test.ts
similarity index 98%
rename from tests/engine/editor/clipboard/import-nodes/undo/redo.test.ts
rename to packages/core/tests/editor/clipboard/import-nodes/undo/redo.test.ts
index 1e4a9a184..81a21a9c2 100644
--- a/tests/engine/editor/clipboard/import-nodes/undo/redo.test.ts
+++ b/packages/core/tests/editor/clipboard/import-nodes/undo/redo.test.ts
@@ -3,8 +3,8 @@ import { describe, expect, it } from 'bun:test'
import { importClipboardNodes } from '@open-pencil/core'
import type { NodeChange, SceneNode } from '@open-pencil/core'
-import { getNodeOrThrow } from '#tests/helpers/assert'
-import { createClipboardGraph } from '#tests/helpers/clipboard'
+import { getNodeOrThrow } from '../../../../helpers/assert'
+import { createClipboardGraph } from '../../../../helpers/clipboard'
describe('importClipboardNodes: undo redo', () => {
it('undo removes all imported nodes including children', () => {
diff --git a/tests/engine/editor/clipboard/paste-target.test.ts b/packages/core/tests/editor/clipboard/paste-target.test.ts
similarity index 98%
rename from tests/engine/editor/clipboard/paste-target.test.ts
rename to packages/core/tests/editor/clipboard/paste-target.test.ts
index a6da637c2..9acbdc1b7 100644
--- a/tests/engine/editor/clipboard/paste-target.test.ts
+++ b/packages/core/tests/editor/clipboard/paste-target.test.ts
@@ -3,7 +3,7 @@ import { describe, expect, test } from 'bun:test'
import { createEditor, type EditorState } from '@open-pencil/core/editor'
import { SceneGraph } from '@open-pencil/scene-graph'
-import { resolvePasteTarget } from '#core/editor/clipboard/paste-target'
+import { resolvePasteTarget } from '../../../src/editor/clipboard/paste-target'
function setup() {
const graph = new SceneGraph()
diff --git a/tests/engine/editor/clipboard/paste-to-replace.test.ts b/packages/core/tests/editor/clipboard/paste-to-replace.test.ts
similarity index 100%
rename from tests/engine/editor/clipboard/paste-to-replace.test.ts
rename to packages/core/tests/editor/clipboard/paste-to-replace.test.ts
diff --git a/tests/engine/editor/components/library-capabilities.test.ts b/packages/core/tests/editor/components/library-capabilities.test.ts
similarity index 100%
rename from tests/engine/editor/components/library-capabilities.test.ts
rename to packages/core/tests/editor/components/library-capabilities.test.ts
diff --git a/tests/engine/editor/components/properties.test.ts b/packages/core/tests/editor/components/properties.test.ts
similarity index 100%
rename from tests/engine/editor/components/properties.test.ts
rename to packages/core/tests/editor/components/properties.test.ts
diff --git a/tests/engine/editor/components/sync-layout-scope.test.ts b/packages/core/tests/editor/components/sync-layout-scope.test.ts
similarity index 91%
rename from tests/engine/editor/components/sync-layout-scope.test.ts
rename to packages/core/tests/editor/components/sync-layout-scope.test.ts
index b80cbc7d8..5a35cdd9a 100644
--- a/tests/engine/editor/components/sync-layout-scope.test.ts
+++ b/packages/core/tests/editor/components/sync-layout-scope.test.ts
@@ -1,9 +1,10 @@
import { describe, expect, test } from 'bun:test'
+import { computeAllLayouts } from '@open-pencil/core/layout'
import { SceneGraph } from '@open-pencil/scene-graph'
-import { createComponentSyncScheduler } from '#core/editor/component-sync'
-import { computeAllLayouts } from '#core/layout'
+import { createComponentSyncScheduler } from '../../../src/editor/component-sync'
+import { expectDefined } from '../../helpers/assert'
function createGraph() {
const graph = new SceneGraph()
@@ -22,7 +23,10 @@ function createGraph() {
paddingLeft: 16
})
const label = graph.createNode('TEXT', component.id, { name: 'Label', text: 'Label', x: 0, y: 0 })
- const instance = graph.createInstance(component.id, instancePage.id, { x: 0, y: 0 })
+ const instance = expectDefined(
+ graph.createInstance(component.id, instancePage.id, { x: 0, y: 0 }),
+ 'instance'
+ )
const unrelated = graph.createNode('FRAME', unrelatedPage.id, {
name: 'Dashboard',
width: 300,
diff --git a/tests/engine/editor/components/variants.test.ts b/packages/core/tests/editor/components/variants.test.ts
similarity index 100%
rename from tests/engine/editor/components/variants.test.ts
rename to packages/core/tests/editor/components/variants.test.ts
diff --git a/tests/engine/editor/effects-and-resize.test.ts b/packages/core/tests/editor/effects-and-resize.test.ts
similarity index 98%
rename from tests/engine/editor/effects-and-resize.test.ts
rename to packages/core/tests/editor/effects-and-resize.test.ts
index 06889debc..12d237711 100644
--- a/tests/engine/editor/effects-and-resize.test.ts
+++ b/packages/core/tests/editor/effects-and-resize.test.ts
@@ -1,8 +1,9 @@
import { describe, test, expect } from 'bun:test'
-import { SceneGraph, type Effect, type Rect } from '@open-pencil/core'
+import { SceneGraph, type Effect } from '@open-pencil/core'
+import type { Rect } from '@open-pencil/scene-graph/primitives'
-import { getNodeOrThrow } from '#tests/helpers/assert'
+import { getNodeOrThrow } from '../helpers/assert'
function pageId(graph: SceneGraph) {
return graph.getPages()[0].id
diff --git a/tests/engine/editor/frame-presets.test.ts b/packages/core/tests/editor/frame-presets.test.ts
similarity index 99%
rename from tests/engine/editor/frame-presets.test.ts
rename to packages/core/tests/editor/frame-presets.test.ts
index 075853e6f..7f0982b74 100644
--- a/tests/engine/editor/frame-presets.test.ts
+++ b/packages/core/tests/editor/frame-presets.test.ts
@@ -3,7 +3,7 @@ import { describe, expect, test } from 'bun:test'
import { createEditor } from '@open-pencil/core/editor'
import { computeLayout } from '@open-pencil/core/layout'
-import { getNodeOrThrow } from '#tests/helpers/assert'
+import { getNodeOrThrow } from '../helpers/assert'
const PHONE_PRESET = { name: 'iPhone Air', width: 420, height: 912 }
const DESKTOP_PRESET = { name: 'Desktop', width: 1440, height: 1024 }
diff --git a/tests/engine/editor/graph/events-integration.test.ts b/packages/core/tests/editor/graph/events-integration.test.ts
similarity index 87%
rename from tests/engine/editor/graph/events-integration.test.ts
rename to packages/core/tests/editor/graph/events-integration.test.ts
index e87b6646b..f74b3905a 100644
--- a/tests/engine/editor/graph/events-integration.test.ts
+++ b/packages/core/tests/editor/graph/events-integration.test.ts
@@ -2,23 +2,22 @@ import { describe, expect, mock, test } from 'bun:test'
import { SceneGraph } from '@open-pencil/scene-graph'
-import type { SkiaRenderer } from '#core/canvas/renderer'
-import { createGraphEventSubscription } from '#core/editor/graph-events'
+import {
+ createGraphEventSubscription,
+ type GraphEventRenderer
+} from '../../../src/editor/graph-events'
function createRenderer() {
const invalidated: string[] = []
- const renderer: Pick<
- SkiaRenderer,
- 'invalidateVectorPath' | 'invalidateNodePicture' | 'tiledScene'
- > & {
- invalidated: string[]
- } = {
+ const renderer: GraphEventRenderer & { invalidated: string[] } = {
invalidateVectorPath: () => undefined,
- invalidateNodePicture: (nodeId: string) => invalidated.push(nodeId),
+ invalidateNodePicture: (nodeId: string) => {
+ invalidated.push(nodeId)
+ },
tiledScene: {
invalidateNode: mock(),
invalidateStructure: mock()
- } as SkiaRenderer['tiledScene'],
+ },
invalidated
}
return renderer
diff --git a/tests/engine/editor/graph/events.test.ts b/packages/core/tests/editor/graph/events.test.ts
similarity index 93%
rename from tests/engine/editor/graph/events.test.ts
rename to packages/core/tests/editor/graph/events.test.ts
index 6ca990782..1c031c009 100644
--- a/tests/engine/editor/graph/events.test.ts
+++ b/packages/core/tests/editor/graph/events.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { rendererInvalidationForChanges } from '#core/editor/graph-events'
+import { rendererInvalidationForChanges } from '../../../src/editor/graph-events'
describe('graph event renderer invalidation', () => {
test('committed updates always invalidate node pictures', () => {
diff --git a/packages/core/tests/editor/graph/replacement.test.ts b/packages/core/tests/editor/graph/replacement.test.ts
new file mode 100644
index 000000000..662d6cd6b
--- /dev/null
+++ b/packages/core/tests/editor/graph/replacement.test.ts
@@ -0,0 +1,23 @@
+import { expect, mock, test } from 'bun:test'
+
+import type { SkiaRenderer } from '@open-pencil/core/canvas'
+import { createEditor } from '@open-pencil/core/editor'
+import { SceneGraph } from '@open-pencil/scene-graph'
+
+test('graph replacement clears tiled state even when page IDs are reused', () => {
+ const editor = createEditor()
+ const invalidateStructure = mock()
+ // Only the tiled-scene invalidation is exercised; the rest of the renderer stays absent.
+ const tiledScene: Partial<SkiaRenderer['tiledScene']> = { invalidateStructure }
+ const renderer: Partial<SkiaRenderer> = {
+ tiledScene: tiledScene as SkiaRenderer['tiledScene'],
+ measureTextNode: undefined
+ }
+ editor.setCanvasKit({} as Parameters<typeof editor.setCanvasKit>[0], renderer as SkiaRenderer)
+ const replacement = new SceneGraph()
+
+ editor.replaceGraph(replacement)
+
+ expect(invalidateStructure).toHaveBeenCalledTimes(1)
+ expect(editor.graph).toBe(replacement)
+})
diff --git a/tests/engine/editor/guides.test.ts b/packages/core/tests/editor/guides.test.ts
similarity index 76%
rename from tests/engine/editor/guides.test.ts
rename to packages/core/tests/editor/guides.test.ts
index 625c1373e..f4f369333 100644
--- a/tests/engine/editor/guides.test.ts
+++ b/packages/core/tests/editor/guides.test.ts
@@ -2,6 +2,8 @@ import { describe, expect, test } from 'bun:test'
import { createEditor } from '@open-pencil/core/editor'
+import { expectDefined } from '../helpers/assert'
+
function setup() {
const editor = createEditor()
const pageId = editor.state.currentPageId
@@ -17,16 +19,16 @@ function setup() {
describe('guide editor actions', () => {
test('adds, moves, removes, and undoes a page guide', () => {
const { editor, pageId } = setup()
- const id = editor.addGuide(pageId, 'x', 42)
+ const id = expectDefined(editor.addGuide(pageId, 'x', 42), 'guide id')
expect(id).not.toBeNull()
expect(editor.graph.getNode(pageId)?.guides).toEqual([{ id, axis: 'x', position: 42 }])
- expect(editor.moveGuide(pageId, id ?? '', 84)).toBe(true)
+ expect(editor.moveGuide(pageId, id, 84)).toBe(true)
expect(editor.graph.getNode(pageId)?.guides[0]?.position).toBe(84)
editor.undoAction()
expect(editor.graph.getNode(pageId)?.guides[0]?.position).toBe(42)
- expect(editor.removeGuide(pageId, id ?? '')).toBe(true)
+ expect(editor.removeGuide(pageId, id)).toBe(true)
expect(editor.graph.getNode(pageId)?.guides).toEqual([])
editor.undoAction()
expect(editor.graph.getNode(pageId)?.guides[0]?.position).toBe(42)
@@ -34,10 +36,10 @@ describe('guide editor actions', () => {
test('transfers a guide between page and frame in one undo step', () => {
const { editor, pageId, frameId } = setup()
- const id = editor.addGuide(pageId, 'y', 120)
+ const id = expectDefined(editor.addGuide(pageId, 'y', 120), 'guide id')
editor.undo.clear()
- expect(editor.transferGuide(pageId, frameId, id ?? '', 20)).toBe(true)
+ expect(editor.transferGuide(pageId, frameId, id, 20)).toBe(true)
expect(editor.graph.getNode(pageId)?.guides).toEqual([])
expect(editor.graph.getNode(frameId)?.guides).toEqual([{ id, axis: 'y', position: 20 }])
@@ -50,7 +52,7 @@ describe('guide editor actions', () => {
const { editor, pageId } = setup()
const rect = editor.graph.createNode('RECTANGLE', pageId)
expect(editor.addGuide(rect.id, 'x', 10)).toBeNull()
- const id = editor.addGuide(pageId, 'x', 10)
- expect(editor.moveGuide(pageId, id ?? '', 10)).toBe(false)
+ const id = expectDefined(editor.addGuide(pageId, 'x', 10), 'guide id')
+ expect(editor.moveGuide(pageId, id, 10)).toBe(false)
})
})
diff --git a/tests/engine/editor/history/atomic-tools.test.ts b/packages/core/tests/editor/history/atomic-tools.test.ts
similarity index 100%
rename from tests/engine/editor/history/atomic-tools.test.ts
rename to packages/core/tests/editor/history/atomic-tools.test.ts
diff --git a/tests/engine/editor/layout/mutation-impact.test.ts b/packages/core/tests/editor/layout/mutation-impact.test.ts
similarity index 96%
rename from tests/engine/editor/layout/mutation-impact.test.ts
rename to packages/core/tests/editor/layout/mutation-impact.test.ts
index 1e121b081..a88fdd1e8 100644
--- a/tests/engine/editor/layout/mutation-impact.test.ts
+++ b/packages/core/tests/editor/layout/mutation-impact.test.ts
@@ -2,7 +2,7 @@ import { describe, expect, test } from 'bun:test'
import { SceneGraph } from '@open-pencil/scene-graph'
-import { createLayoutRunner } from '#core/editor/layout-runner'
+import { createLayoutRunner } from '../../../src/editor/layout-runner'
function pageId(graph: SceneGraph): string {
return graph.getPages()[0].id
diff --git a/tests/engine/editor/navigation-lifecycle.test.ts b/packages/core/tests/editor/navigation-lifecycle.test.ts
similarity index 100%
rename from tests/engine/editor/navigation-lifecycle.test.ts
rename to packages/core/tests/editor/navigation-lifecycle.test.ts
diff --git a/tests/engine/editor/node-preview.test.ts b/packages/core/tests/editor/node-preview.test.ts
similarity index 100%
rename from tests/engine/editor/node-preview.test.ts
rename to packages/core/tests/editor/node-preview.test.ts
diff --git a/tests/engine/editor/nudge.test.ts b/packages/core/tests/editor/nudge.test.ts
similarity index 98%
rename from tests/engine/editor/nudge.test.ts
rename to packages/core/tests/editor/nudge.test.ts
index 78414d50b..6b01d1952 100644
--- a/tests/engine/editor/nudge.test.ts
+++ b/packages/core/tests/editor/nudge.test.ts
@@ -2,7 +2,7 @@ import { describe, test, expect } from 'bun:test'
import { createEditor } from '@open-pencil/core/editor'
-import { getNodeOrThrow } from '#tests/helpers/assert'
+import { getNodeOrThrow } from '../helpers/assert'
describe('nudgeSelected', () => {
function setup() {
diff --git a/tests/engine/editor/opacity.test.ts b/packages/core/tests/editor/opacity.test.ts
similarity index 98%
rename from tests/engine/editor/opacity.test.ts
rename to packages/core/tests/editor/opacity.test.ts
index c2cbb378d..a9fb11b39 100644
--- a/tests/engine/editor/opacity.test.ts
+++ b/packages/core/tests/editor/opacity.test.ts
@@ -2,7 +2,7 @@ import { describe, test, expect } from 'bun:test'
import { createEditor, opacityFromBuffer } from '@open-pencil/core/editor'
-import { getNodeOrThrow } from '#tests/helpers/assert'
+import { getNodeOrThrow } from '../helpers/assert'
describe('editor.setOpacity', () => {
function setup() {
diff --git a/tests/engine/editor/pages/loading.test.ts b/packages/core/tests/editor/pages/loading.test.ts
similarity index 93%
rename from tests/engine/editor/pages/loading.test.ts
rename to packages/core/tests/editor/pages/loading.test.ts
index 296753f68..5e7226987 100644
--- a/tests/engine/editor/pages/loading.test.ts
+++ b/packages/core/tests/editor/pages/loading.test.ts
@@ -1,8 +1,9 @@
import { expect, test } from 'bun:test'
+import { createEditor } from '@open-pencil/core/editor'
import { SceneGraph } from '@open-pencil/scene-graph'
-import { createEditor, type PageSwitchProgress } from '#core/editor'
+import type { PageSwitchProgress } from '../../../src/editor/pages'
test('core page preparation only reports progress and never owns app suspension', async () => {
const graph = new SceneGraph()
@@ -14,7 +15,7 @@ test('core page preparation only reports progress and never owns app suspension'
fontWeight: 400
})
const progress: PageSwitchProgress[] = []
- let release: (() => void) | null = null
+ let release: () => void = () => undefined
const fontReady = new Promise<void>((resolve) => {
release = resolve
})
@@ -32,7 +33,7 @@ test('core page preparation only reports progress and never owns app suspension'
await Promise.resolve()
expect(progress.some((entry) => entry.phase === 'resolving-fonts')).toBe(true)
- release?.()
+ release()
await switching
expect(progress).toContainEqual(
expect.objectContaining({ phase: 'resolving-fonts', completed: 1, total: 1 })
@@ -49,7 +50,7 @@ test('prepares a target page without exposing it before commit', async () => {
fontFamily: 'Loader Test',
fontWeight: 400
})
- let release: (() => void) | null = null
+ let release: () => void = () => undefined
const fontReady = new Promise<void>((resolve) => {
release = resolve
})
@@ -69,7 +70,7 @@ test('prepares a target page without exposing it before commit', async () => {
expect(editor.state.currentPageId).toBe(firstPage.id)
expect(pageChanges).toEqual([])
- release?.()
+ release()
const prepared = await preparing
expect(editor.state.currentPageId).toBe(firstPage.id)
expect(prepared).not.toBeNull()
@@ -90,7 +91,7 @@ test('aborted page preparation preserves the visible page', async () => {
fontFamily: 'Loader Test',
fontWeight: 400
})
- let release: (() => void) | null = null
+ let release: () => void = () => undefined
const fontReady = new Promise<void>((resolve) => {
release = resolve
})
@@ -106,7 +107,7 @@ test('aborted page preparation preserves the visible page', async () => {
const preparing = editor.preparePage(secondPage.id, { signal: abort.signal })
await Promise.resolve()
abort.abort()
- release?.()
+ release()
await expect(preparing).rejects.toHaveProperty('name', 'AbortError')
expect(editor.state.currentPageId).toBe(firstPage.id)
@@ -144,7 +145,7 @@ test('loading page nodes for a lookup does not supersede a page switch in progre
const target = graph.addPage('Target')
const searched = graph.addPage('Searched')
graph.createNode('TEXT', target.id, { text: 'Loading', fontFamily: 'Loader Test' })
- let release: (() => void) | null = null
+ let release: () => void = () => undefined
const fontReady = new Promise<void>((resolve) => {
release = resolve
})
@@ -160,7 +161,7 @@ test('loading page nodes for a lookup does not supersede a page switch in progre
const switching = editor.switchPage(target.id)
await Promise.resolve()
await editor.loadPageNodes(searched.id)
- release?.()
+ release()
await switching
expect(editor.state.currentPageId).toBe(target.id)
diff --git a/tests/engine/editor/preview-events.test.ts b/packages/core/tests/editor/preview-events.test.ts
similarity index 100%
rename from tests/engine/editor/preview-events.test.ts
rename to packages/core/tests/editor/preview-events.test.ts
diff --git a/tests/engine/editor/selection/alignment.test.ts b/packages/core/tests/editor/selection/alignment.test.ts
similarity index 97%
rename from tests/engine/editor/selection/alignment.test.ts
rename to packages/core/tests/editor/selection/alignment.test.ts
index 214d42813..7bc944105 100644
--- a/tests/engine/editor/selection/alignment.test.ts
+++ b/packages/core/tests/editor/selection/alignment.test.ts
@@ -2,8 +2,8 @@ import { describe, expect, test } from 'bun:test'
import { SceneGraph } from '@open-pencil/core'
-import { getNodeOrThrow } from '#tests/helpers/assert'
-import { createRect, firstPageId } from '#tests/helpers/scene'
+import { getNodeOrThrow } from '../../helpers/assert'
+import { createRect, firstPageId } from '../../helpers/scene'
describe('single-node alignment to parent', () => {
function setup() {
diff --git a/tests/engine/editor/selection/distribution.test.ts b/packages/core/tests/editor/selection/distribution.test.ts
similarity index 100%
rename from tests/engine/editor/selection/distribution.test.ts
rename to packages/core/tests/editor/selection/distribution.test.ts
diff --git a/tests/engine/editor/selection/flip.test.ts b/packages/core/tests/editor/selection/flip.test.ts
similarity index 91%
rename from tests/engine/editor/selection/flip.test.ts
rename to packages/core/tests/editor/selection/flip.test.ts
index cc913945f..aba630110 100644
--- a/tests/engine/editor/selection/flip.test.ts
+++ b/packages/core/tests/editor/selection/flip.test.ts
@@ -2,8 +2,8 @@ import { describe, expect, test } from 'bun:test'
import { SceneGraph } from '@open-pencil/core'
-import { expectDefined, getNodeOrThrow } from '#tests/helpers/assert'
-import { createRect, firstPageId } from '#tests/helpers/scene'
+import { expectDefined, getNodeOrThrow } from '../../helpers/assert'
+import { createRect, firstPageId } from '../../helpers/scene'
describe('flip', () => {
test('flipX defaults to false', () => {
@@ -42,11 +42,11 @@ describe('flip', () => {
describe('flip roundtrip via kiwi', () => {
async function roundtrip(graph: SceneGraph) {
const { initCodec } = await import('@open-pencil/kiwi/fig/codec')
- const { parseFigFile } = await import('#core/kiwi/fig/file')
- const { exportFigFile } = await import('#core/io/formats/fig/export')
+ const { parseFigFile } = await import('@open-pencil/core/kiwi')
+ const { exportFigFile } = await import('@open-pencil/core/io/formats/fig')
await initCodec()
const buf = await exportFigFile(graph)
- return parseFigFile(buf)
+ return parseFigFile(buf.slice().buffer)
}
function findChild(graph: SceneGraph, name: string) {
diff --git a/tests/engine/editor/selection/hit-test.test.ts b/packages/core/tests/editor/selection/hit-test.test.ts
similarity index 100%
rename from tests/engine/editor/selection/hit-test.test.ts
rename to packages/core/tests/editor/selection/hit-test.test.ts
diff --git a/tests/engine/editor/selection/properties.test.ts b/packages/core/tests/editor/selection/properties.test.ts
similarity index 96%
rename from tests/engine/editor/selection/properties.test.ts
rename to packages/core/tests/editor/selection/properties.test.ts
index 679af4f48..27c6d8b92 100644
--- a/tests/engine/editor/selection/properties.test.ts
+++ b/packages/core/tests/editor/selection/properties.test.ts
@@ -2,8 +2,8 @@ import { describe, expect, test } from 'bun:test'
import { SceneGraph } from '@open-pencil/core'
-import { getNodeOrThrow } from '#tests/helpers/assert'
-import { createRect, firstPageId } from '#tests/helpers/scene'
+import { getNodeOrThrow } from '../../helpers/assert'
+import { createRect, firstPageId } from '../../helpers/scene'
describe('multi-node property merging', () => {
test('same values merge to single value', () => {
diff --git a/tests/engine/editor/selection/semantics.test.ts b/packages/core/tests/editor/selection/semantics.test.ts
similarity index 100%
rename from tests/engine/editor/selection/semantics.test.ts
rename to packages/core/tests/editor/selection/semantics.test.ts
diff --git a/tests/engine/editor/structure/boolean.test.ts b/packages/core/tests/editor/structure/boolean.test.ts
similarity index 100%
rename from tests/engine/editor/structure/boolean.test.ts
rename to packages/core/tests/editor/structure/boolean.test.ts
diff --git a/tests/engine/editor/structure/flatten.test.ts b/packages/core/tests/editor/structure/flatten.test.ts
similarity index 94%
rename from tests/engine/editor/structure/flatten.test.ts
rename to packages/core/tests/editor/structure/flatten.test.ts
index f3b752503..aabe04893 100644
--- a/tests/engine/editor/structure/flatten.test.ts
+++ b/packages/core/tests/editor/structure/flatten.test.ts
@@ -1,11 +1,12 @@
import { describe, expect, test } from 'bun:test'
-import { initCanvasKit } from '#cli/headless'
-import { SkiaRenderer } from '#core/canvas'
-import { BLACK, TRANSPARENT } from '#core/constants'
-import { createEditor } from '#core/editor'
-import { fontManager } from '#core/text/fonts'
-import { textNodeToOutlineLayout } from '#core/text/outlines'
+import { SkiaRenderer } from '@open-pencil/core/canvas'
+import { BLACK, TRANSPARENT } from '@open-pencil/core/constants'
+import { createEditor } from '@open-pencil/core/editor'
+import { initCanvasKit } from '@open-pencil/core/io'
+import { fontManager } from '@open-pencil/core/text'
+
+import { textNodeToOutlineLayout } from '../../../src/text/outlines'
async function createEditorWithRenderer() {
const ck = await initCanvasKit()
@@ -78,8 +79,8 @@ describe('flattenSelected', () => {
y: 30,
width: 40,
height: 30,
- fills: [TRANSPARENT],
- strokes: [{ type: 'SOLID', color: BLACK, weight: 8, opacity: 1, visible: true }]
+ fills: [{ type: 'SOLID', color: TRANSPARENT, opacity: 1, visible: true }],
+ strokes: [{ color: BLACK, weight: 8, opacity: 1, visible: true, align: 'CENTER' }]
})
editor.select([rect.id])
@@ -106,8 +107,8 @@ describe('flattenSelected', () => {
y: 30,
width: 40,
height: 30,
- fills: [TRANSPARENT],
- strokes: [{ type: 'SOLID', color: BLACK, weight: 8, opacity: 1, visible: true }]
+ fills: [{ type: 'SOLID', color: TRANSPARENT, opacity: 1, visible: true }],
+ strokes: [{ color: BLACK, weight: 8, opacity: 1, visible: true, align: 'CENTER' }]
})
editor.select([rect.id])
editor.groupSelected()
@@ -365,9 +366,7 @@ describe('flattenSelected', () => {
width: 50,
height: 40,
fills: [],
- strokes: [
- { type: 'SOLID', color: BLACK, opacity: 1, visible: true, weight: 8, align: 'CENTER' }
- ]
+ strokes: [{ color: BLACK, opacity: 1, visible: true, weight: 8, align: 'CENTER' }]
})
editor.select([rect.id])
diff --git a/tests/engine/editor/structure/frame-selection.test.ts b/packages/core/tests/editor/structure/frame-selection.test.ts
similarity index 100%
rename from tests/engine/editor/structure/frame-selection.test.ts
rename to packages/core/tests/editor/structure/frame-selection.test.ts
diff --git a/tests/engine/editor/structure/state.test.ts b/packages/core/tests/editor/structure/state.test.ts
similarity index 94%
rename from tests/engine/editor/structure/state.test.ts
rename to packages/core/tests/editor/structure/state.test.ts
index 26a6a5738..ef52a2fde 100644
--- a/tests/engine/editor/structure/state.test.ts
+++ b/packages/core/tests/editor/structure/state.test.ts
@@ -3,8 +3,8 @@ import { describe, expect, test } from 'bun:test'
import { createEditor } from '@open-pencil/core/editor'
import { computeAllLayouts } from '@open-pencil/core/layout'
-import { getNodeOrThrow } from '#tests/helpers/assert'
-import { rect } from '#tests/helpers/layout'
+import { getNodeOrThrow } from '../../helpers/assert'
+import { rect } from '../../helpers/layout'
describe('structure state actions', () => {
test('toggleNodeVisibility reflows HUG auto-layout instance slots', async () => {
diff --git a/tests/engine/editor/structure/z-order.test.ts b/packages/core/tests/editor/structure/z-order.test.ts
similarity index 100%
rename from tests/engine/editor/structure/z-order.test.ts
rename to packages/core/tests/editor/structure/z-order.test.ts
diff --git a/tests/engine/editor/text-auto-resize.test.ts b/packages/core/tests/editor/text-auto-resize.test.ts
similarity index 98%
rename from tests/engine/editor/text-auto-resize.test.ts
rename to packages/core/tests/editor/text-auto-resize.test.ts
index 4d4cca2f2..a3242db3a 100644
--- a/tests/engine/editor/text-auto-resize.test.ts
+++ b/packages/core/tests/editor/text-auto-resize.test.ts
@@ -3,7 +3,7 @@ import { afterEach, describe, expect, test } from 'bun:test'
import { createEditor } from '@open-pencil/core/editor'
import { setTextMeasurer } from '@open-pencil/core/layout'
-import { getNodeOrThrow } from '#tests/helpers/assert'
+import { getNodeOrThrow } from '../helpers/assert'
afterEach(() => {
setTextMeasurer(null)
diff --git a/tests/engine/editor/undo/basic.test.ts b/packages/core/tests/editor/undo/basic.test.ts
similarity index 98%
rename from tests/engine/editor/undo/basic.test.ts
rename to packages/core/tests/editor/undo/basic.test.ts
index bc24571a7..baf1af536 100644
--- a/tests/engine/editor/undo/basic.test.ts
+++ b/packages/core/tests/editor/undo/basic.test.ts
@@ -1,6 +1,6 @@
import { describe, test, expect } from 'bun:test'
-import { createUndoManager, undoEntry } from '#tests/helpers/undo'
+import { createUndoManager, undoEntry } from '../../helpers/undo'
describe('UndoManager', () => {
test('initial state', () => {
diff --git a/tests/engine/editor/undo/batch-idle.test.ts b/packages/core/tests/editor/undo/batch-idle.test.ts
similarity index 97%
rename from tests/engine/editor/undo/batch-idle.test.ts
rename to packages/core/tests/editor/undo/batch-idle.test.ts
index d2df7393b..e4eedd174 100644
--- a/tests/engine/editor/undo/batch-idle.test.ts
+++ b/packages/core/tests/editor/undo/batch-idle.test.ts
@@ -1,6 +1,6 @@
import { describe, test, expect } from 'bun:test'
-import { createUndoManager, noop, undoEntry } from '#tests/helpers/undo'
+import { createUndoManager, noop, undoEntry } from '../../helpers/undo'
function assignValue(setValue: (value: number) => void, value: number) {
return () => setValue(value)
diff --git a/tests/engine/editor/undo/create-instance.test.ts b/packages/core/tests/editor/undo/create-instance.test.ts
similarity index 98%
rename from tests/engine/editor/undo/create-instance.test.ts
rename to packages/core/tests/editor/undo/create-instance.test.ts
index 1da3d7397..529bd0830 100644
--- a/tests/engine/editor/undo/create-instance.test.ts
+++ b/packages/core/tests/editor/undo/create-instance.test.ts
@@ -3,7 +3,7 @@ import { describe, expect, test } from 'bun:test'
import { createEditor } from '@open-pencil/core/editor'
import { getAxisAlignedWorldBounds } from '@open-pencil/scene-graph/coordinate'
-import { expectDefined } from '#tests/helpers/assert'
+import { expectDefined } from '../../helpers/assert'
describe('create instance undo/redo', () => {
test('places a nested component beside its world bounds on the page', () => {
diff --git a/tests/engine/editor/undo/create-shape.test.ts b/packages/core/tests/editor/undo/create-shape.test.ts
similarity index 97%
rename from tests/engine/editor/undo/create-shape.test.ts
rename to packages/core/tests/editor/undo/create-shape.test.ts
index 9d3e266d7..fe39c1445 100644
--- a/tests/engine/editor/undo/create-shape.test.ts
+++ b/packages/core/tests/editor/undo/create-shape.test.ts
@@ -2,7 +2,7 @@ import { describe, test, expect } from 'bun:test'
import { createEditor } from '@open-pencil/core/editor'
-import { getNodeOrThrow } from '#tests/helpers/assert'
+import { getNodeOrThrow } from '../../helpers/assert'
describe('create shape undo/redo', () => {
test('batched create+resize undoes in one step', () => {
diff --git a/tests/engine/editor/undo/group-resize.test.ts b/packages/core/tests/editor/undo/group-resize.test.ts
similarity index 93%
rename from tests/engine/editor/undo/group-resize.test.ts
rename to packages/core/tests/editor/undo/group-resize.test.ts
index db1a5ead5..3ead26fdf 100644
--- a/tests/engine/editor/undo/group-resize.test.ts
+++ b/packages/core/tests/editor/undo/group-resize.test.ts
@@ -2,8 +2,9 @@ import { describe, expect, test } from 'bun:test'
import { createEditor } from '@open-pencil/core/editor'
import type { VectorNetwork } from '@open-pencil/scene-graph'
+import { createResizeSnapshot } from '@open-pencil/scene-graph/resize'
-import { getNodeOrThrow } from '#tests/helpers/assert'
+import { getNodeOrThrow } from '../../helpers/assert'
const originalVectorNetwork: VectorNetwork = {
vertices: [
@@ -97,13 +98,12 @@ describe('resize undo', () => {
[
vector.id,
{
+ ...createResizeSnapshot(vector),
x: 0,
y: 0,
width: 10,
height: 10,
- vectorNetwork: originalVectorNetwork,
- fillGeometry: [],
- strokeGeometry: []
+ vectorNetwork: originalVectorNetwork
}
]
])
diff --git a/tests/engine/editor/undo/history-events.test.ts b/packages/core/tests/editor/undo/history-events.test.ts
similarity index 100%
rename from tests/engine/editor/undo/history-events.test.ts
rename to packages/core/tests/editor/undo/history-events.test.ts
diff --git a/tests/engine/editor/undo/redo-sequence.test.ts b/packages/core/tests/editor/undo/redo-sequence.test.ts
similarity index 96%
rename from tests/engine/editor/undo/redo-sequence.test.ts
rename to packages/core/tests/editor/undo/redo-sequence.test.ts
index 687b19e1f..7be6559f5 100644
--- a/tests/engine/editor/undo/redo-sequence.test.ts
+++ b/packages/core/tests/editor/undo/redo-sequence.test.ts
@@ -1,7 +1,7 @@
import { describe, test, expect } from 'bun:test'
-import { expectDefined, getNodeOrThrow } from '#tests/helpers/assert'
-import { createHistoryFrame, setupEditorPage } from '#tests/helpers/editor-history'
+import { expectDefined, getNodeOrThrow } from '../../helpers/assert'
+import { createHistoryFrame, setupEditorPage } from '../../helpers/editor-history'
describe('undo/redo multi-step sequences', () => {
test('create → move → duplicate → move copy → undo all → redo all', () => {
diff --git a/tests/engine/editor/undo/variable-bindings.test.ts b/packages/core/tests/editor/undo/variable-bindings.test.ts
similarity index 77%
rename from tests/engine/editor/undo/variable-bindings.test.ts
rename to packages/core/tests/editor/undo/variable-bindings.test.ts
index 7eb0141bb..7cc1f4577 100644
--- a/tests/engine/editor/undo/variable-bindings.test.ts
+++ b/packages/core/tests/editor/undo/variable-bindings.test.ts
@@ -2,6 +2,8 @@ import { describe, expect, test } from 'bun:test'
import { createEditor } from '@open-pencil/core/editor'
+import { getNodeOrThrow } from '../../helpers/assert'
+
function pageId(editor: ReturnType<typeof createEditor>): string {
return editor.graph.getPages()[0].id
}
@@ -37,13 +39,13 @@ describe('variable-bindings undo resilience', () => {
})
editor.bindVariable(node.id, 'fills/0/color', 'v1')
- expect(editor.graph.getNode(node.id).boundVariables['fills/0/color']).toBe('v1')
+ expect(getNodeOrThrow(editor.graph, node.id).boundVariables['fills/0/color']).toBe('v1')
editor.bindVariable(node.id, 'fills/0/color', 'v2')
- expect(editor.graph.getNode(node.id).boundVariables['fills/0/color']).toBe('v2')
+ expect(getNodeOrThrow(editor.graph, node.id).boundVariables['fills/0/color']).toBe('v2')
editor.undo.undo()
- expect(editor.graph.getNode(node.id).boundVariables['fills/0/color']).toBe('v1')
+ expect(getNodeOrThrow(editor.graph, node.id).boundVariables['fills/0/color']).toBe('v1')
})
test('bindVariable undo gracefully degrades when variable was deleted', () => {
@@ -56,14 +58,14 @@ describe('variable-bindings undo resilience', () => {
})
editor.bindVariable(node.id, 'fills/0/color', 'v1')
- expect(editor.graph.getNode(node.id).boundVariables['fills/0/color']).toBe('v1')
+ expect(getNodeOrThrow(editor.graph, node.id).boundVariables['fills/0/color']).toBe('v1')
// Delete the variable after binding — binding entry remains on the node
editor.graph.removeVariable('v1')
editor.undo.undo()
// Undo should not throw — graceful degradation: binding is simply not restored
- expect(editor.graph.getNode(node.id).boundVariables['fills/0/color']).toBeUndefined()
+ expect(getNodeOrThrow(editor.graph, node.id).boundVariables['fills/0/color']).toBeUndefined()
})
test('unbindVariable undo gracefully degrades when variable was deleted', () => {
@@ -77,14 +79,14 @@ describe('variable-bindings undo resilience', () => {
editor.bindVariable(node.id, 'fills/0/color', 'v1')
editor.unbindVariable(node.id, 'fills/0/color')
- expect(editor.graph.getNode(node.id).boundVariables['fills/0/color']).toBeUndefined()
+ expect(getNodeOrThrow(editor.graph, node.id).boundVariables['fills/0/color']).toBeUndefined()
// Delete the variable after unbinding — the undo inverse will try to rebind it
editor.graph.removeVariable('v1')
editor.undo.undo()
// Undo should not throw — graceful degradation: binding is simply not restored
- expect(editor.graph.getNode(node.id).boundVariables['fills/0/color']).toBeUndefined()
+ expect(getNodeOrThrow(editor.graph, node.id).boundVariables['fills/0/color']).toBeUndefined()
})
test('bindVariable undo with prev binding restore when variable still exists', () => {
@@ -101,16 +103,16 @@ describe('variable-bindings undo resilience', () => {
// Pre-bind the second fill
editor.bindVariable(node.id, 'fills/1/color', 'v1')
- expect(editor.graph.getNode(node.id).boundVariables['fills/1/color']).toBe('v1')
+ expect(getNodeOrThrow(editor.graph, node.id).boundVariables['fills/1/color']).toBe('v1')
// Bind the first fill (no previous binding)
editor.bindVariable(node.id, 'fills/0/color', 'v1')
- expect(editor.graph.getNode(node.id).boundVariables['fills/0/color']).toBe('v1')
+ expect(getNodeOrThrow(editor.graph, node.id).boundVariables['fills/0/color']).toBe('v1')
editor.undo.undo()
// Should restore the pre-existing binding on fills/1
- expect(editor.graph.getNode(node.id).boundVariables['fills/0/color']).toBeUndefined()
- expect(editor.graph.getNode(node.id).boundVariables['fills/1/color']).toBe('v1')
+ expect(getNodeOrThrow(editor.graph, node.id).boundVariables['fills/0/color']).toBeUndefined()
+ expect(getNodeOrThrow(editor.graph, node.id).boundVariables['fills/1/color']).toBe('v1')
})
test('bindVariable redo gracefully degrades when variable was deleted', () => {
@@ -129,7 +131,7 @@ describe('variable-bindings undo resilience', () => {
editor.undo.redo()
- expect(editor.graph.getNode(node.id).boundVariables['fills/0/color']).toBeUndefined()
+ expect(getNodeOrThrow(editor.graph, node.id).boundVariables['fills/0/color']).toBeUndefined()
})
test('unbindVariable redo gracefully degrades when variable was deleted', () => {
@@ -149,6 +151,6 @@ describe('variable-bindings undo resilience', () => {
editor.undo.redo()
- expect(editor.graph.getNode(node.id).boundVariables['fills/0/color']).toBeUndefined()
+ expect(getNodeOrThrow(editor.graph, node.id).boundVariables['fills/0/color']).toBeUndefined()
})
})
diff --git a/tests/engine/editor/vectorize.test.ts b/packages/core/tests/editor/vectorize.test.ts
similarity index 97%
rename from tests/engine/editor/vectorize.test.ts
rename to packages/core/tests/editor/vectorize.test.ts
index 6a0d5f23a..cf4a71363 100644
--- a/tests/engine/editor/vectorize.test.ts
+++ b/packages/core/tests/editor/vectorize.test.ts
@@ -3,7 +3,7 @@ import { describe, expect, test } from 'bun:test'
import { createEditor } from '@open-pencil/core/editor'
import { svgToVectorPaths } from '@open-pencil/core/vector'
-import { expectDefined, getNodeOrThrow } from '#tests/helpers/assert'
+import { expectDefined, getNodeOrThrow } from '../helpers/assert'
function vectorizedInset() {
return expectDefined(
diff --git a/tests/engine/editor/view-state.test.ts b/packages/core/tests/editor/view-state.test.ts
similarity index 100%
rename from tests/engine/editor/view-state.test.ts
rename to packages/core/tests/editor/view-state.test.ts
diff --git a/packages/core/tests/helpers/assert.ts b/packages/core/tests/helpers/assert.ts
new file mode 100644
index 000000000..d4d48ef65
--- /dev/null
+++ b/packages/core/tests/helpers/assert.ts
@@ -0,0 +1,12 @@
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+
+export function expectDefined<T>(value: T | null | undefined, label = 'value'): NonNullable<T> {
+ if (value == null) {
+ throw new Error(`${label} was expected to be defined`)
+ }
+ return value
+}
+
+export function getNodeOrThrow(graph: SceneGraph, id: string): SceneNode {
+ return expectDefined(graph.getNode(id), `node ${id}`)
+}
diff --git a/tests/helpers/clipboard.ts b/packages/core/tests/helpers/clipboard.ts
similarity index 77%
rename from tests/helpers/clipboard.ts
rename to packages/core/tests/helpers/clipboard.ts
index a4a3f5103..a81e6df79 100644
--- a/tests/helpers/clipboard.ts
+++ b/packages/core/tests/helpers/clipboard.ts
@@ -1,4 +1,4 @@
-import { SceneGraph } from '@open-pencil/core'
+import { SceneGraph } from '@open-pencil/scene-graph'
export function createClipboardGraph(): { graph: SceneGraph; pageId: string } {
const graph = new SceneGraph()
diff --git a/tests/helpers/editor-history.ts b/packages/core/tests/helpers/editor-history.ts
similarity index 100%
rename from tests/helpers/editor-history.ts
rename to packages/core/tests/helpers/editor-history.ts
diff --git a/packages/core/tests/helpers/layout.ts b/packages/core/tests/helpers/layout.ts
new file mode 100644
index 000000000..305079d5a
--- /dev/null
+++ b/packages/core/tests/helpers/layout.ts
@@ -0,0 +1,31 @@
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+
+export function autoFrame(
+ graph: SceneGraph,
+ parentId: string,
+ overrides: Partial<SceneNode> = {}
+): SceneNode {
+ return graph.createNode('FRAME', parentId, {
+ layoutMode: 'HORIZONTAL',
+ primaryAxisSizing: 'FIXED',
+ counterAxisSizing: 'FIXED',
+ width: 400,
+ height: 200,
+ ...overrides
+ })
+}
+
+export function rect(
+ graph: SceneGraph,
+ parentId: string,
+ w = 50,
+ h = 50,
+ overrides: Partial<SceneNode> = {}
+): SceneNode {
+ return graph.createNode('RECTANGLE', parentId, {
+ name: 'Rect',
+ width: w,
+ height: h,
+ ...overrides
+ })
+}
diff --git a/packages/core/tests/helpers/scene.ts b/packages/core/tests/helpers/scene.ts
new file mode 100644
index 000000000..9e6a67dc1
--- /dev/null
+++ b/packages/core/tests/helpers/scene.ts
@@ -0,0 +1,19 @@
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+
+export function firstPageId(graph: SceneGraph): string {
+ return graph.getPages()[0].id
+}
+
+export function createRect(
+ graph: SceneGraph,
+ parentId: string,
+ props: { name?: string; x?: number; y?: number; width?: number; height?: number } = {}
+): SceneNode {
+ return graph.createNode('RECTANGLE', parentId, {
+ name: props.name ?? 'Rect',
+ x: props.x ?? 0,
+ y: props.y ?? 0,
+ width: props.width ?? 50,
+ height: props.height ?? 50
+ })
+}
diff --git a/packages/core/tests/helpers/undo.ts b/packages/core/tests/helpers/undo.ts
new file mode 100644
index 000000000..0b3994b2c
--- /dev/null
+++ b/packages/core/tests/helpers/undo.ts
@@ -0,0 +1,11 @@
+import { UndoManager } from '@open-pencil/scene-graph'
+
+export function noop(): void {}
+
+export function createUndoManager(options?: ConstructorParameters<typeof UndoManager>[0]) {
+ return new UndoManager(options)
+}
+
+export function undoEntry(label: string, forward: () => void = noop, inverse: () => void = noop) {
+ return { label, forward, inverse }
+}
diff --git a/packages/core/tsconfig.test.json b/packages/core/tsconfig.test.json
new file mode 100644
index 000000000..bf7812d8b
--- /dev/null
+++ b/packages/core/tsconfig.test.json
@@ -0,0 +1,10 @@
+{
+ "extends": "./tsconfig.json",
+ "compilerOptions": {
+ "noEmit": true,
+ "declaration": false,
+ "declarationMap": false,
+ "rootDir": "."
+ },
+ "include": ["src", "tests"]
+}
diff --git a/packages/docs/development/testing.md b/packages/docs/development/testing.md
index 20d0f1e66..4178767c0 100644
--- a/packages/docs/development/testing.md
+++ b/packages/docs/development/testing.md
@@ -20,13 +20,13 @@ Core tests using SceneGraph still belong to Core. Central integration is for con
**Migration status:** much existing coverage remains under `tests/engine/**`, alongside package-local suites. The table is the agreed destination, not a claim that migration is complete. Until a domain migrates, extend its existing suite rather than create a second home. The repository-wide migration is separate from feature work.
-`bun run check:test-homes` keeps the debt shrinking: every test under `tests/engine` must be listed in `tools/dev/unit-tests/engine-baseline.txt`, so a new test fails the check until it lives in its owner's canonical home, and a moved file must be removed from the baseline. Scene Graph tests have migrated to `packages/scene-graph/tests`.
+`bun run check:test-homes` keeps the debt shrinking: every test under `tests/engine` must be listed in `tools/dev/unit-tests/engine-baseline.txt`, so a new test fails the check until it lives in its owner's canonical home, and a moved file must be removed from the baseline. Scene Graph tests have migrated to `packages/scene-graph/tests`, and the editor domain to `packages/core/tests/editor` with its helpers under `packages/core/tests/helpers`; Core's `typecheck` script type-checks those tests.
Discovery already covers the destinations: `tools/dev/unit-tests/src/shards.ts` groups tests by owner and lists each owner's canonical home (`packages/<owner>/tests`, `tests/app`, `tests/integration`) together with the `tests/engine` directories it still owns, so `bun run test:unit` and the CI shards run a file from either place. Moving a domain is therefore a `git mv` plus import fixes; only a new owner or a new top-level home needs a shard entry. Do not move files into a directory the shard map does not list.
`test:unit:quick` runs files in Bun worker processes (`--parallel`), which is the fastest local loop. CI shards still run each group in one process; `test:unit:isolated` (`--isolate`, also run nightly) gives every file a fresh global object and is the check to run when a suite passes alone but fails in a shard. Shards share one Bun process, so module-level state (a `fake-indexeddb/auto` import, an IndexedDB connection left open by `createEditorStore()`, a patched global) leaks into later files in the same shard. A package-local run (`bun test tests` inside the package) is a fresh process and will not reproduce that leak. Close what a test opens and restore what it patches.
-Run `bun --filter @open-pencil/core build` before unit tests. Files under `tests/` resolve `@open-pencil/core` and its subpaths to `packages/core/src` through the root tsconfig, but package sources (`packages/dom-css/src`, `packages/mcp/src`, …) use their own tsconfig, where `@open-pencil/core/<subpath>` falls back to the package `exports` and therefore to `dist`. One process can hold both copies; only `packages/vue` maps Core to `src`. Aligning the other package tsconfigs is a packaging change (it affects `tsdown` declaration output), not a test change.
+Run `bun --filter @open-pencil/core build` before unit tests. Files under `tests/` and under `packages/core/tests` resolve `@open-pencil/core` and its subpaths to `packages/core/src` through the root and Core tsconfig path mappings, but other package sources (`packages/dom-css/src`, `packages/mcp/src`, …) use their own tsconfig, where `@open-pencil/core/<subpath>` falls back to the package `exports` and therefore to `dist`. One process can hold both copies; only `packages/vue` maps Core to `src`. Aligning the other package tsconfigs is a packaging change (it affects `tsdown` declaration output), not a test change.
## Test purpose
diff --git a/tests/AGENTS.md b/tests/AGENTS.md
index 18afd3e12..1492408ce 100644
--- a/tests/AGENTS.md
+++ b/tests/AGENTS.md
@@ -5,7 +5,7 @@
## Placement
- Package-local tests mirror source domains under `packages/<owner>/tests/`; central app tests mirror `src/app/**` under `tests/app/`; `tests/integration/` requires a genuinely cross-owner contract; E2E under `tests/e2e/` follows user workflows; native and Figma acceptance are explicit exceptions.
-- Existing `tests/engine/**` domains migrate together with runner discovery: `tools/dev/unit-tests/src/shards.ts` lists each owner's canonical home and its current `tests/engine` directories, so a move is a `git mv` plus imports. `bun run check:test-homes` rejects any test added under `tests/engine` and any stale entry in `tools/dev/unit-tests/engine-baseline.txt`; new tests go to the canonical home, and a moved file is removed from the baseline (`--write` regenerates it). Scene Graph has migrated to `packages/scene-graph/tests`.
+- Existing `tests/engine/**` domains migrate together with runner discovery: `tools/dev/unit-tests/src/shards.ts` lists each owner's canonical home and its current `tests/engine` directories, so a move is a `git mv` plus imports. `bun run check:test-homes` rejects any test added under `tests/engine` and any stale entry in `tools/dev/unit-tests/engine-baseline.txt`; new tests go to the canonical home, and a moved file is removed from the baseline (`--write` regenerates it). Scene Graph has migrated to `packages/scene-graph/tests` and the editor domain to `packages/core/tests/editor`; put new Core tests there, mirroring `packages/core/src`.
- Owner-local helpers and fixtures stay local; only genuinely shared support goes under central `tests/helpers/<domain>/` and `tests/fixtures/`. MCP transport tests: `tests/engine/mcp/{server,stdio,transport}` with `tests/helpers/mcp`.
- Never commit temporary, diagnostic, or profile specs; keep them in ignored `scratch/`.
diff --git a/tests/engine/editor/graph/replacement.test.ts b/tests/engine/editor/graph/replacement.test.ts
deleted file mode 100644
index 61e490eb2..000000000
--- a/tests/engine/editor/graph/replacement.test.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { expect, mock, test } from 'bun:test'
-
-import { SceneGraph } from '@open-pencil/scene-graph'
-
-import type { SkiaRenderer } from '#core/canvas/renderer'
-import { createEditor } from '#core/editor'
-
-test('graph replacement clears tiled state even when page IDs are reused', () => {
- const editor = createEditor()
- const renderer = {
- tiledScene: { invalidateStructure: mock() },
- measureTextNode: undefined
- } as SkiaRenderer
- editor.setCanvasKit({} as Parameters<typeof editor.setCanvasKit>[0], renderer)
- const replacement = new SceneGraph()
-
- editor.replaceGraph(replacement)
-
- expect(renderer.tiledScene.invalidateStructure).toHaveBeenCalledTimes(1)
- expect(editor.graph).toBe(replacement)
-})
diff --git a/tests/helpers/undo.ts b/tests/helpers/undo.ts
deleted file mode 100644
index 86b736a6d..000000000
--- a/tests/helpers/undo.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { UndoManager } from '@open-pencil/core'
-
-export function noop() {
- return undefined
-}
-
-export function createUndoManager(options?: ConstructorParameters<typeof UndoManager>[0]) {
- return new UndoManager(options)
-}
-
-export function undoEntry(label: string, forward = noop, inverse = noop) {
- return { label, forward, inverse }
-}
diff --git a/tools/checks/test-homes/engine-baseline.txt b/tools/checks/test-homes/engine-baseline.txt
index 06a803c3d..bdc2495ca 100644
--- a/tools/checks/test-homes/engine-baseline.txt
+++ b/tools/checks/test-homes/engine-baseline.txt
@@ -1,7 +1,7 @@
# Unit tests still under tests/engine, the migration debt from
# packages/docs/development/testing.md. New tests go to the owner's canonical
# home; remove a line here when its file moves. Regenerate with
-# `bun tools/dev/unit-tests/src/check-homes.ts --write`.
+# `bun tools/checks/test-homes/src/index.ts --write`.
tests/engine/acp/permission.test.ts
tests/engine/acp/transport.test.ts
tests/engine/app/ai/attachment/image.test.ts
@@ -139,60 +139,6 @@ tests/engine/dom-css/conversion.test.ts
tests/engine/dom-css/jsx.test.ts
tests/engine/dom-css/runtime.test.ts
tests/engine/dom-css/tailwind.test.ts
-tests/engine/editor/clipboard/binding-corruption.test.ts
-tests/engine/editor/clipboard/delete.test.ts
-tests/engine/editor/clipboard/figma-images.test.ts
-tests/engine/editor/clipboard/file-placement.test.ts
-tests/engine/editor/clipboard/import-nodes/components.test.ts
-tests/engine/editor/clipboard/import-nodes/filtering.test.ts
-tests/engine/editor/clipboard/import-nodes/hierarchy.test.ts
-tests/engine/editor/clipboard/import-nodes/instance-linkage.test.ts
-tests/engine/editor/clipboard/import-nodes/paste-scope.test.ts
-tests/engine/editor/clipboard/import-nodes/styling.test.ts
-tests/engine/editor/clipboard/import-nodes/text/metrics.test.ts
-tests/engine/editor/clipboard/import-nodes/undo/redo.test.ts
-tests/engine/editor/clipboard/paste-target.test.ts
-tests/engine/editor/clipboard/paste-to-replace.test.ts
-tests/engine/editor/components/library-capabilities.test.ts
-tests/engine/editor/components/properties.test.ts
-tests/engine/editor/components/sync-layout-scope.test.ts
-tests/engine/editor/components/variants.test.ts
-tests/engine/editor/effects-and-resize.test.ts
-tests/engine/editor/frame-presets.test.ts
-tests/engine/editor/graph/events-integration.test.ts
-tests/engine/editor/graph/events.test.ts
-tests/engine/editor/graph/replacement.test.ts
-tests/engine/editor/guides.test.ts
-tests/engine/editor/history/atomic-tools.test.ts
-tests/engine/editor/layout/mutation-impact.test.ts
-tests/engine/editor/navigation-lifecycle.test.ts
-tests/engine/editor/node-preview.test.ts
-tests/engine/editor/nudge.test.ts
-tests/engine/editor/opacity.test.ts
-tests/engine/editor/pages/loading.test.ts
-tests/engine/editor/preview-events.test.ts
-tests/engine/editor/selection/alignment.test.ts
-tests/engine/editor/selection/distribution.test.ts
-tests/engine/editor/selection/flip.test.ts
-tests/engine/editor/selection/hit-test.test.ts
-tests/engine/editor/selection/properties.test.ts
-tests/engine/editor/selection/semantics.test.ts
-tests/engine/editor/structure/boolean.test.ts
-tests/engine/editor/structure/flatten.test.ts
-tests/engine/editor/structure/frame-selection.test.ts
-tests/engine/editor/structure/state.test.ts
-tests/engine/editor/structure/z-order.test.ts
-tests/engine/editor/text-auto-resize.test.ts
-tests/engine/editor/undo/basic.test.ts
-tests/engine/editor/undo/batch-idle.test.ts
-tests/engine/editor/undo/create-instance.test.ts
-tests/engine/editor/undo/create-shape.test.ts
-tests/engine/editor/undo/group-resize.test.ts
-tests/engine/editor/undo/history-events.test.ts
-tests/engine/editor/undo/redo-sequence.test.ts
-tests/engine/editor/undo/variable-bindings.test.ts
-tests/engine/editor/vectorize.test.ts
-tests/engine/editor/view-state.test.ts
tests/engine/figma/api/absolute/position.test.ts
tests/engine/figma/api/auto-layout/basic.test.ts
tests/engine/figma/api/auto-layout/extras.test.ts