fix(editor): name vertex handles after their zone, in a named group

Criterion 18: « Sommet {n} de {nom} », « Ajouter un sommet après le sommet
{n} de {nom} », « Retirer le sommet {n} de {nom} » (EN « Vertex {n} of
{name} » …), {nom} the zone's display name in the current locale; the
handle group is a role="group" named « Sommets de {nom} ».

Tests: no assertion removed; every unit and e2e locator that read the old
names now reads the same handle with the zone name appended (fixtures: N,
Vertèbres thoraciques, Zone dessinée, Zone clavier). New unit tests in
editor-zone-edit cover the FR names, the group and the EN locale.
This commit is contained in:
bchanot committed 2026-11-18 14:09:24 +01:00
1 parent fab641c278
commit b6aa2819ea
15 files changed
+165 -67

No files matched your search

@@ -708,7 +708,7 @@ describe('polygons and paths', () => {
it('« + » adds a vertex on the drawing and « − » removes it', async () => {
await mount({ text: zoneText({ type: 'polygon', points: triangle }) })
await selectFromList()
pressAt(handleHit('Ajouter un sommet après le sommet 1'), 50, 20)
pressAt(handleHit('Ajouter un sommet après le sommet 1 de N'), 50, 20)
expect(geometryOf('zone-a')).toMatchObject({
points: [
[20, 20],
@@ -717,16 +717,16 @@ describe('polygons and paths', () => {
[50, 80],
],
})
pressAt(handleHit('Retirer le sommet 2'), 50, 10)
pressAt(handleHit('Retirer le sommet 2 de N'), 50, 10)
expect(geometryOf('zone-a')).toMatchObject({ points: triangle })
})
it('never removes a vertex below three: « − » is greyed', async () => {
await mount({ text: zoneText({ type: 'polygon', points: triangle }) })
await selectFromList()
pressAt(handleHit('Sommet 1'), 20, 20)
pressAt(handleHit('Sommet 1 de N'), 20, 20)
expect(
screen.getByRole('button', { name: 'Retirer le sommet 1' }),
screen.getByRole('button', { name: 'Retirer le sommet 1 de N' }),
).toHaveAttribute('aria-disabled', 'true')
})
@@ -909,7 +909,7 @@ describe('refusals through the tab (H8)', () => {
await selectFromList()
const before = store.getState().documentText
const vertex = screen
.getByRole('button', { name: 'Sommet 1' })
.getByRole('button', { name: 'Sommet 1 de N' })
.querySelector('[data-handle]')!
mouseDrag(vertex, [20, 20], [500, 20])
expect(store.getState().documentText).toBe(before)