Lot U : « Autres versions » repliées dans le vote ; contrôles corrigés après le premier passage (état partagé, nom du titre en anglais, attente du chargement) ; le panier dit « simulé » ; CLAUDE.md (composants, panneau, 38 contrôles)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Yvv
2026-11-03 08:19:15 +01:00
co-authored by Claude Opus 5.5
parent 5d3b5152ff
commit 6fb82382c0
12 changed files with 61 additions and 20 deletions
+1
View File
@@ -14,6 +14,7 @@ const mine = async (page: Page): Promise<Entry[]> => (await (await page.request.
/** Unfolds the vote of an open proposal, from « Propositions en cours » (its sections folded: lot U). */
async function unfold(page: Page, title: string) {
await page.locator('ul.deep li.section').first().waitFor();
const all = page.getByRole('button', { name: 'Tout déplier' });
if (await all.isVisible()) await all.click();
// By its title only: the excerpt of another proposal may name it.
+2 -1
View File
@@ -87,7 +87,8 @@ test('M1 — mobile : logo dans la barre, l’accueil sous la voûte, menu en ti
expect((await toggle.boundingBox())?.height ?? 0).toBeGreaterThanOrEqual(44);
await toggle.click();
const fold = page.locator('section.text section.fold');
await expect(fold.getByText('9 oui sur 12 votants pour passer', { exact: true })).toBeVisible();
// Level 2, the quorum 12: « sur 12 votants » before any vote; the desktop controls may have voted.
await expect(fold.locator('.need')).toHaveText(/^9 oui (sur 12 votants pour passer|pour passer · le quorum la bloque)$/);
// The settings of the formula read on a phone: the table of the five levels holds in the sheet.
await fold.getByRole('button', { name: 'Réglages de la formule' }).click();
const panel = page.locator('aside.panel');
+6 -3
View File
@@ -100,8 +100,9 @@ test('C25 — l’ordre des articles : une ligne en fin de section, réordonnée
await expect(fold).toHaveAttribute('aria-label', 'Le vote de « Ordre des articles · Conclusion »');
await expect(fold.getByRole('list', { name: 'Ordre proposé' }).locator('li')).toHaveText([K2, K1]);
await expect(order).toContainText('1 ordre proposé');
await expect(page.locator('ul.deep button.row', { hasText: 'Ordre des articles' })).toHaveCount(0);
// The order in force is read from it, among its other versions.
await expect(page.locator('ul.deep button.row .title', { hasText: /^Ordre des articles · / })).toHaveCount(0);
// The order in force is read from it, among its other versions (folded until asked).
await fold.getByRole('button', { name: 'Autres versions (1)' }).click();
await expect(fold.getByRole('region', { name: 'Autres versions' })).toContainText('Ordre en vigueur');
const pid = ((await fold.getAttribute('id')) ?? '').replace(/^vote-/, '');
await fold.getByRole('button', { name: 'Pour', exact: true }).click();
@@ -132,7 +133,9 @@ test('C26 — le titre du document : proposé et voté en tête, ses traductions
await signIn(page, 'Chiara');
await page.goto(TEST_DOC);
const head = page.locator('header.head');
const bar = head.getByRole('group', { name: 'Titre du document' });
// A module, named for what it is (in French here; the language changes below).
await expect(head.getByRole('group', { name: 'Titre du document' })).toBeVisible();
const bar = head.locator('.title-unit');
await expect(bar).toContainText('Titre du document · seed a minima · 0 vote');
await expect(bar).toContainText('inertie 4 / 5 · haute');
await head.hover();
+2 -1
View File
@@ -32,7 +32,7 @@ test('C35 — réordonner une section : les poignées sur ses articles, au gliss
await expect(line.getByText(E1)).toHaveCount(0);
// Nowhere a block that repeats the articles of a section, and no order among the proposals.
await expect(page.locator('section.text').getByText('Ordre des articles ·', { exact: false })).toHaveCount(0);
await expect(page.locator('ul.deep').getByText('Ordre des articles', { exact: false })).toHaveCount(0);
await expect(page.locator('ul.deep').getByText(/^Ordre des articles · /)).toHaveCount(0);
await line.scrollIntoViewIfNeeded();
await shot(page, 'c35-1-ligne-ordre');
@@ -99,6 +99,7 @@ test('C35 — réordonner une section : les poignées sur ses articles, au gliss
}
expect(await moduleInForce(page, pid)).toBe(true);
await page.goto(TEST_DOC);
await expect(page.locator('section.text article.unit', { hasText: E2 })).toBeVisible();
const titles = await page.locator('section.text article.unit h2').allTextContents();
expect(titles.indexOf(E2)).toBeGreaterThan(-1);
expect(titles.indexOf(E2)).toBeLessThan(titles.indexOf(E1));
+3 -2
View File
@@ -295,8 +295,9 @@ test('C19 — un article, une ligne : ses versions se déplient', async ({ page
// A version unfolds its vote below it, as any proposal.
await versions.nth(1).click();
await expect(versions.nth(1)).toHaveAttribute('aria-expanded', 'true');
// Level 3, the quorum 50 (ADR 0013): 39 « pour » at no vote, the voters missing counted as « non ».
await expect(page.locator('section.fold').getByText('39 oui sur 50 votants pour passer', { exact: true })).toBeVisible();
// Level 3, the quorum 50 (ADR 0013): 39 « oui » pass it, the voters missing counted as « non »
// (« sur 50 votants » before any vote; a « contre » of another control may be there already).
await expect(page.locator('section.fold .need')).toHaveText(/^39 oui (sur 50 votants pour passer|pour passer · le quorum la bloque)$/);
await expect(page).toHaveURL(/vote=/);
await e3.click();
await expect(e3).toHaveAttribute('aria-expanded', 'false');
+5 -3
View File
@@ -20,7 +20,8 @@ test('C21 — le vote déplié sous l’article : ton vote, les totaux, le seuil
await expect(toggle).toHaveAttribute('aria-expanded', 'true');
await expect(toggle).toHaveAttribute('aria-controls', (await fold.getAttribute('id')) ?? '');
// How far the threshold is: the water, the totals, the votes asked and those missing.
await expect(fold.getByRole('img', { name: /Niveau : \d+ % du seuil/ })).toBeVisible();
// (the first: its other versions, inside, have theirs)
await expect(fold.getByRole('img', { name: /Niveau : \d+ % du seuil/ }).first()).toBeVisible();
await expect(fold.getByText(/^\d+ oui sur \d+ votants? pour passer$/)).toBeVisible();
await expect(fold.getByText(/^Il manque \d+ voix pour\.$/)).toBeVisible();
await expect(fold.getByText("Tu n'as pas voté sur cette version.")).toBeVisible();
@@ -196,8 +197,9 @@ test('C24 — sans compte de vote, le vote par la chaîne est fermé et le dit ;
const fold = page.locator('section.text section.fold');
await expect(fold.getByText("Le vote par la chaîne Ğ1 n'est pas encore ouvert : le compte qui reçoit les votes reste à créer.", { exact: false })).toBeVisible();
await expect(fold.getByRole('button', { name: 'Pour', exact: true })).toHaveCount(0);
// The totals and how far it is stay in sight: Raison d'être, level 2, the quorum 12 (ADR 0013).
await expect(fold.getByText('9 oui sur 12 votants pour passer', { exact: true })).toBeVisible();
// The totals and how far it is stay in sight: Raison d'être, level 2, the quorum 12 (ADR 0013) —
// « sur 12 votants » before any vote; C23 may have counted a voice already.
await expect(fold.locator('.need')).toHaveText(/^9 oui (sur 12 votants pour passer|pour passer · le quorum la bloque)$/);
await fold.getByText('Ton vote ne se montre à personne', { exact: false }).scrollIntoViewIfNeeded();
await shot(page, '6-vote-ferme');
// The basket, opened by its address, says the vote is closed — never « Tes votes comptent dès l'envoi ».