fix(editor): vertex keys act on the focused handle after an undo

This commit is contained in:
bchanot committed 2026-11-19 11:20:19 +01:00
1 parent 6df66f9bb9
commit df46390bdb
3 files changed
+47 -11

No files matched your search

+5 -3
View File
@@ -197,10 +197,12 @@ test.describe('editor zones on the drawing (U2 Task 5)', () => {
expect(await count(page)).toBe(stored.length - 1)
await undoTo(page, () => shownPoints(page), stored)
// The undo cleared the choice, the focus stayed: Backspace acts on that same handle.
await page.keyboard.press('Backspace')
expect(await count(page)).toBe(stored.length - 1)
await undoTo(page, () => shownPoints(page), stored)
// « + » adds after the focused vertex, as Insert, the canvas zoom untouched; undone.
// The undo cleared the choice but left the focus: moving it chooses again.
await handle(page, 'Sommet 2 de Vertèbres thoraciques').focus()
await handle(page, 'Sommet 3 de Vertèbres thoraciques').focus()
const drawing = page.getByTestId('annotation-canvas-drawing').locator('..')
const framed = () =>
drawing.evaluate((el) => getComputedStyle(el).transform)