From 39a75b1350e3f9f66d5ca97712b32be051198ea5 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Wed, 21 Oct 2026 10:25:53 +0000 Subject: [PATCH] test(addons): assert the single shell title on the Voice and Face pages The add-on shell now shows the one title, "Voice" or "Face", and the page no longer repeats it. The tests still looked for the h1 "Voices" and "Faces". Assert that the add-on page has exactly one h1 and that it is the shell title. The core pages keep their own "Voices" and "Faces" titles. Assisted-by: Claude Code:claude-sonnet-5-5 playwright Signed-off-by: Ettore Di Giacinto --- core/http/react-ui/e2e/addon-navigation.spec.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/core/http/react-ui/e2e/addon-navigation.spec.js b/core/http/react-ui/e2e/addon-navigation.spec.js index 1ccf91734..db0dfa0b3 100644 --- a/core/http/react-ui/e2e/addon-navigation.spec.js +++ b/core/http/react-ui/e2e/addon-navigation.spec.js @@ -315,7 +315,9 @@ test.describe('Add-on navigation: the Voice recognition page', () => { await mockIdentity(page) await page.goto('/app/addons/voice/voice/recognition') await expect(page.getByTestId('voices-page')).toBeVisible() - await expect(page.getByRole('heading', { name: 'Voices', level: 1 })).toBeVisible() + // The add-on shell shows the one title; the page does not repeat it. + await expect(page.getByRole('heading', { level: 1 })).toHaveCount(1) + await expect(page.getByRole('heading', { name: 'Voice', exact: true, level: 1 })).toBeVisible() await expectVoiceTabs(page, 'recognition') await expect(page.locator('[data-testid="addon-surface"][data-addon="voice"]')).toBeVisible() await expect(page.getByTestId('known-empty')).toContainText('Nobody enrolled in this browser yet') @@ -512,9 +514,12 @@ async function asFaceAdmin(page, features = {}) { await page.route('**/api/auth/status', route => route.fulfill({ json: sessionFor(ADMIN, { addons: true, face_recognition: true, ...features }) })) } -async function expectFacesPage(page) { +// The core page titles itself "Faces"; inside the add-on shell the shell shows +// the one title, "Face", and the page does not repeat it. +async function expectFacesPage(page, title = 'Faces') { await expect(page.getByTestId('faces-page')).toBeVisible() - await expect(page.getByRole('heading', { name: 'Faces', level: 1 })).toBeVisible() + await expect(page.getByRole('heading', { level: 1 })).toHaveCount(1) + await expect(page.getByRole('heading', { name: title, exact: true, level: 1 })).toBeVisible() } test.describe('Add-on navigation: the Face recognition page', () => { @@ -524,7 +529,7 @@ test.describe('Add-on navigation: the Face recognition page', () => { await serveFace(page) await mockIdentity(page) await page.goto('/app/addons/face/recognition') - await expectFacesPage(page) + await expectFacesPage(page, 'Face') await expect(page.locator('[data-testid="addon-surface"][data-addon="face"]')).toBeVisible() await expect(page.getByTestId('known-empty')).toContainText('Nobody enrolled in this browser yet') })