feat(editor): Backspace and « + » on a vertex handle

This commit is contained in:
bchanot committed 2026-11-19 11:16:55 +01:00
1 parent c01c6f3145
commit 6df66f9bb9
5 files changed
+108 -10

No files matched your search

@@ -352,6 +352,21 @@ describe('« Reprendre le tracé » edits the closed shape with its handles (boa
expect(untouched()).toEqual(before)
})
it('Backspace and « + » on a pending vertex act as Delete and Insert, nothing held', async () => {
await resumed()
const before = untouched()
const vertex = (n: number) =>
screen.getByRole('button', { name: `Sommet ${n} de Tibia` })
vertex(1).focus()
expect(fireEvent.keyDown(vertex(1), { key: '+' })).toBe(false)
expect(shape()).toHaveLength(5)
expect(shape()![1]).toEqual([50, 20])
expect(useAnnotationWork.getState().chosen).toMatchObject({ vertex: 1 })
expect(fireEvent.keyDown(vertex(2), { key: 'Backspace' })).toBe(false)
expect(shape()).toEqual(SQUARE)
expect(untouched()).toEqual(before)
})
it('« − » at three vertices is refused with its reason', async () => {
await resumed('Tibia', SQUARE.slice(0, 3))
clickHandle('Sommet 1 de Tibia', [20, 20])