test(app): shell proof of the sheet list search, sort and dates

admin-sheets-list.spec.ts (sandbox, fr and en, desktop and 375 px): three
draft sheets of this run, the oldest saved last; search, count line against
the list answer of the same load, order by last modification then by name,
the Paris date format, a search cut at 100 characters and its clearing, axe
and no sideways scroll on the searched list, the empty state and
/app/admin; the home's latest changes. Teardown soft-deletes only the ids
this run created (D7).

allSheetsLink (e2e/support/admin.ts): the sheets card link named
admin.home.all_sheets or admin.home.see_all with any number.

R-24, locators rewritten (assertions unchanged):
- admin.spec.ts A1: areaCard(...).getByRole('link', { name:
  dict['admin.home.all_sheets'] }) -> allSheetsLink(areaCard(...), dict)
- admin.spec.ts access per right: sheets.getByRole('link', { name:
  dict['admin.home.all_sheets'] }) -> allSheetsLink(sheets, dict)
- editor-journey.spec.ts createSheetFromAdmin: section locator
  .getByRole('link', { name: dict['admin.home.all_sheets'] }) ->
  allSheetsLink(section locator, dict)
This commit is contained in:
bchanot committed 2026-11-16 17:34:43 +01:00
1 parent 2326e1cb15
commit b4a5254068
4 files changed
+353 -11

No files matched your search

+5 -5
View File
@@ -1,7 +1,7 @@
import { fr } from '@/i18n/fr'
import type { Locator, Page, TestInfo } from '@playwright/test'
import { sql } from '../../../../packages/supabase/tests/sandbox/stack'
import { stepUpAdmin } from '../support/admin'
import { allSheetsLink, stepUpAdmin } from '../support/admin'
import { expect, expectAccessible, test } from '../support/browser'
import { dropLateReplays, routeToSandbox } from '../support/sandbox'
import {
@@ -56,10 +56,10 @@ const clickButton = (page: Page, name: string) =>
page.getByRole('button', { name, exact: true }).click()
async function createSheetFromAdmin(page: Page, tag: string): Promise<string> {
await page
.locator('section[aria-labelledby="admin-sheets-title"]')
.getByRole('link', { name: dict['admin.home.all_sheets'] })
.click()
await allSheetsLink(
page.locator('section[aria-labelledby="admin-sheets-title"]'),
dict,
).click()
await main(page).getByRole('link', { name: dict['admin.sheets.new'] }).click()
// The list page has a species filter with the same label: wait for the form's heading.
await expect(