Skip to content

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

test(snapping): verify pixel rounding without guides

Danila Poyarkov7af5e05f9c2b
diff --git a/tests/e2e/snap/guides.spec.ts b/tests/e2e/snap/guides.spec.ts
index 46250546e..7c8a10315 100644
--- a/tests/e2e/snap/guides.spec.ts
+++ b/tests/e2e/snap/guides.spec.ts
@@ -141,6 +141,10 @@ test('pixel snapping preference controls fractional object movement', async () =
await page.mouse.move(box.x + 166.25, box.y + 147.25)
await page.mouse.down()
await page.mouse.move(box.x + 172.8, box.y + 155.05, { steps: 5 })
+ expect(await snapGuides()).toEqual([])
+ if (process.platform === 'darwin') {
+ expect(await canvas.screenshotCanvas()).toMatchSnapshot('pixel-rounding-without-guides.png')
+ }
await page.mouse.up()
expect(await selectedPosition()).toEqual({ x: 133, y: 115 })
canvas.assertNoErrors()
diff --git a/tests/e2e/snap/guides.spec.ts-snapshots/pixel-rounding-without-guides-openpencil-darwin.png b/tests/e2e/snap/guides.spec.ts-snapshots/pixel-rounding-without-guides-openpencil-darwin.png
new file mode 100644
index 000000000..62fff511f
Binary files /dev/null and b/tests/e2e/snap/guides.spec.ts-snapshots/pixel-rounding-without-guides-openpencil-darwin.png differ
diff --git a/tests/engine/vue/input/node-edit-snap.test.ts b/tests/engine/vue/input/node-edit-snap.test.ts
index 3bd15830a..60da8ac19 100644
--- a/tests/engine/vue/input/node-edit-snap.test.ts
+++ b/tests/engine/vue/input/node-edit-snap.test.ts
@@ -203,6 +203,6 @@ describe('vector edit snapping', () => {
expect(snapped.x).toBeCloseTo(1.8)
expect(snapped.y).toBeCloseTo(3.6)
- expect(editor.state.snapGuides.map((guide) => guide.axis).sort()).toEqual(['x', 'y'])
+ expect(editor.state.snapGuides).toEqual([])
})
})