forked from yvv/decision
Lot S, phase 2 : le quorum dans l'interface (fr, en, es), e2e 35 / 35
- types.ts : evaluation.quorum / yesNeeded / noNeeded, levels[].quorum, l'unité quorum / quorumDefault / canSetQuorum, doc.quorums (optionnels) ; publication « suspended » (ADR 0011) ; - Réglages de la formule : la colonne « Quorum » des cinq crans et sa note, la participation de référence « deux fois 50, le quorum de référence » ; plus de ligne C ; sur téléphone, les six colonnes tiennent dans la feuille ; - La formule du seuil : T' = max(T, Q), R = B^W + ratio(T')·T', la ligne Q (le quorum de la version) au lieu de C ; - textes : deep.note, formula.reading, settings.* parlent du quorum, plus de C (test vu rouge puis vert, tests/unit/inertia.test.ts) ; - e2e : Seuil 9 (cran 2) et 39 (cran 3) dans Monnaie libre, les quorums 12 · 12 · 50 · 50 · 50, voix pour à 100 votants 60 · 67 · 75 · 83 · 90, à 0 votant 8 · 9 · 39 · 43 · 46. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+14
-8
@@ -283,7 +283,8 @@ 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');
|
||||
await expect(page.locator('section.fold').getByText('Seuil : 50 voix pour')).toBeVisible();
|
||||
// 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('Seuil : 39 voix pour')).toBeVisible();
|
||||
await expect(page).toHaveURL(/vote=/);
|
||||
await e3.click();
|
||||
await expect(e3).toHaveAttribute('aria-expanded', 'false');
|
||||
@@ -299,19 +300,22 @@ test('C20 — réglages de la formule et cinq crans', async ({ page }) => {
|
||||
const panel = page.locator('aside.panel');
|
||||
await expect(panel.getByRole('heading', { name: 'Réglages de la formule' })).toBeVisible();
|
||||
await expect(panel.getByText(/W — électorat : 5\s745/)).toBeVisible();
|
||||
await expect(panel.getByText('C — minimum de voix pour : 50')).toBeVisible();
|
||||
// No vote yet: the reference, twice C.
|
||||
await expect(panel.getByText(/100 votants sur 5\s745 \(1,74 %\), deux fois C : la participation de référence/)).toBeVisible();
|
||||
// No vote yet: the reference, twice the reference quorum (ADR 0013).
|
||||
await expect(panel.getByText(/100 votants sur 5\s745 \(1,74 %\), deux fois 50, le quorum de référence : la participation de référence/)).toBeVisible();
|
||||
const rows = panel.locator('table tbody tr');
|
||||
await expect(rows).toHaveCount(5);
|
||||
await expect(rows.locator('th')).toHaveText([/1\s*très basse/, /2\s*basse/, /3\s*moyenne/, /4\s*haute/, /5\s*très haute/]);
|
||||
await expect(rows.locator('td:nth-child(2)')).toHaveText(['50 %', '50 %', '55 %', '60 %', '66 %']);
|
||||
await expect(rows.locator('td:nth-child(4)')).toHaveText(['60 %', '67 %', '75 %', '83 %', '90 %']);
|
||||
// At 100 voters: C plus each level's share of the 50 votes beyond C.
|
||||
// The quorum of each level (Yvv: « 12 · 12 · 50 · 50 · 50 »).
|
||||
const quorums = rows.locator('td:nth-child(5)');
|
||||
await expect(quorums).toHaveText(['12', '12', '50', '50', '50']);
|
||||
// At 100 voters, above every quorum: each level's share of the 100.
|
||||
const required = panel.locator('table tbody td.required');
|
||||
await expect(required).toHaveText(['80', '84', '88', '92', '95']);
|
||||
await expect(required).toHaveText(['60', '67', '75', '83', '90']);
|
||||
await expect(panel.getByText("Voix pour : à 100 votants, comme d'habitude.")).toBeVisible();
|
||||
await expect(panel.getByText("Part exigée : les « pour » demandés au-delà de C, à 100 votants comme d'habitude.")).toBeVisible();
|
||||
await expect(panel.getByText("Part exigée : la part de « pour » demandée, à 100 votants comme d'habitude.")).toBeVisible();
|
||||
await expect(panel.getByText(/^Quorum : en dessous, les votants qui manquent comptent comme « non »\./)).toBeVisible();
|
||||
await page.keyboard.press('Escape');
|
||||
|
||||
// From the vote of an article: Unicité du compte, a seed proposal, is at 2 / 5, its row is marked.
|
||||
@@ -322,7 +326,9 @@ test('C20 — réglages de la formule et cinq crans', async ({ page }) => {
|
||||
await expect(panel.locator('tr.current')).toHaveCount(1);
|
||||
await expect(panel.locator('tr.current th')).toContainText('2');
|
||||
await expect(panel.locator('tr.current th')).toContainText('cet article');
|
||||
await expect(required).toHaveText(['50', '50', '50', '50', '50']);
|
||||
// No vote: each level on its quorum, the voters missing counted as « non ».
|
||||
await expect(quorums).toHaveText(['12', '12', '50', '50', '50']);
|
||||
await expect(required).toHaveText(['8', '9', '39', '43', '46']);
|
||||
await expect(panel.getByText('Voix pour : à 0 votant, la participation de cette version.')).toBeVisible();
|
||||
await page.keyboard.press('Escape');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user