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

@@ -295,11 +295,15 @@ test.describe('editor annotations (A3)', () => {
// « + » after vertex 1 by Enter: four vertices; Delete on the chosen one: three again.
await page
.getByRole('button', { name: 'Ajouter un sommet après le sommet 1' })
.getByRole('button', {
name: 'Ajouter un sommet après le sommet 1 de Zone clavier',
})
.focus()
await page.keyboard.press('Enter')
await expect.poll(async () => (await shownPoints(page)).length).toBe(4)
await page.getByRole('button', { name: 'Sommet 2', exact: true }).focus()
await page
.getByRole('button', { name: 'Sommet 2 de Zone clavier', exact: true })
.focus()
await page.keyboard.press('Delete')
await expect.poll(async () => (await shownPoints(page)).length).toBe(3)
// Escape unchooses the vertex (board 32 row 5): the strip offers the zone's move.
+4 -1
View File
@@ -222,7 +222,10 @@ async function modifyAnnotations(page: Page) {
await expect(shownShape(page)).toHaveAttribute('cx', String(point))
await pickAnnotation(page, dict, /Zone dessinée/)
const [[start]] = await shownPoints(page)
const first = page.getByRole('button', { name: 'Sommet 1', exact: true })
const first = page.getByRole('button', {
name: 'Sommet 1 de Zone dessinée',
exact: true,
})
const vertex = await stepRight(page, first, start, MODIFIED.vertex)
await expect.poll(async () => (await shownPoints(page))[0][0]).toBe(vertex)
await pickAnnotation(page, dict, /Accès essai/)
+10 -5
View File
@@ -104,7 +104,9 @@ test.describe('editor zones on the drawing (U2 Task 5)', () => {
// The row sits low in the equine list: the click left the drawing out of view.
await scrollToTop(page)
await expect(selectionTag(page)).toContainText('Vertèbres thoraciques')
await expect(handle(page, 'Sommet 9')).toBeAttached()
await expect(
handle(page, 'Sommet 9 de Vertèbres thoraciques'),
).toBeAttached()
// R-18: at fit zoom some segments are too short for their « + ».
await expect(page.getByTestId('edit-strip-notice')).toContainText(
dict['editor.annotations.strip.zoom_hint'],
@@ -125,7 +127,10 @@ test.describe('editor zones on the drawing (U2 Task 5)', () => {
// « + » on the segment from vertex 2: a vertex added and chosen, then undone.
await expectNoShift(page, async () => {
await pressHandle(page, 'Ajouter un sommet après le sommet 2')
await pressHandle(
page,
'Ajouter un sommet après le sommet 2 de Vertèbres thoraciques',
)
await expect(line(page)).toContainText(
dict['editor.annotations.message.vertex_added'],
)
@@ -138,13 +143,13 @@ test.describe('editor zones on the drawing (U2 Task 5)', () => {
// « − » on the chosen vertex 3, then undone.
await expectNoShift(page, async () => {
await pressHandle(page, 'Sommet 3')
await pressHandle(page, 'Sommet 3 de Vertèbres thoraciques')
await expect(page.getByTestId('edit-strip-detail')).toContainText(
'sommet 3 choisi',
)
})
await expectNoShift(page, async () => {
await pressHandle(page, 'Retirer le sommet 3')
await pressHandle(page, 'Retirer le sommet 3 de Vertèbres thoraciques')
await expect(line(page)).toContainText(
dict['editor.annotations.message.vertex_removed'],
)
@@ -172,7 +177,7 @@ test.describe('editor zones on the drawing (U2 Task 5)', () => {
requests.forbid(actor.account.email, actor.account.password)
await pickAnnotation(page, dict, THORACIC)
const [, second] = await shownPoints(page)
await handle(page, 'Sommet 2').focus()
await handle(page, 'Sommet 2 de Vertèbres thoraciques').focus()
await page.keyboard.press('ArrowDown')
// Not under expectNoShift: the button returns the focus to the list row, which
// scrolls it into view by design.