From d57326d8adedc370d16cb6dc329d7784647c02cb Mon Sep 17 00:00:00 2001 From: Yvv Date: Tue, 3 Nov 2026 06:12:28 +0100 Subject: [PATCH] =?UTF-8?q?Lot=20V,=20VoteFold=20(changement=20minimal=20a?= =?UTF-8?q?utoris=C3=A9=20par=20orch,=20M6=20sans=20U)=20:=20=C2=AB=20ton?= =?UTF-8?q?=20vote=20=C2=BB=20lit=20myVoteState=20=E2=80=94=20simul=C3=A9?= =?UTF-8?q?=20au=20lieu=20d'enregistr=C3=A9,=20rien=20d'enregistr=C3=A9=20?= =?UTF-8?q?pour=20une=20intention=20en=20attente=20;=20la=20note=20du=20vo?= =?UTF-8?q?te=20simul=C3=A9=20pr=C3=A8s=20des=20boutons=20;=20=C2=AB=20don?= =?UTF-8?q?t=20N=20simul=C3=A9s=20=C2=BB=20sur=20les=20totaux.=20C34=20le?= =?UTF-8?q?=20v=C3=A9rifie=20sous=20l'article,=20vu=20rouge=20puis=20vert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- web/e2e/vote.spec.ts | 6 ++++++ web/src/lib/components/VoteFold.svelte | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/web/e2e/vote.spec.ts b/web/e2e/vote.spec.ts index b6de14a..92c2c9f 100644 --- a/web/e2e/vote.spec.ts +++ b/web/e2e/vote.spec.ts @@ -247,6 +247,12 @@ test('C34 — la chaîne fermée, Monnaie libre vote quand même : le vote simul await expect(page.getByRole('dialog', { name: 'Voter avec ton portefeuille Ğ1' })).toHaveCount(0); await expect(fold.locator('.voted')).toHaveText(/^Ton vote : contre/); await expect(fold.getByText(`0 pour · ${before.p.tally.against + 1} contre`)).toBeVisible(); + // Under the article: marked « simulé », never « enregistré »; the note, once, by the buttons. + await expect(fold.locator('.voted')).toHaveText('Ton vote : contre · simulé'); + await expect(fold.getByText('enregistré', { exact: false })).toHaveCount(0); + await expect(fold.getByText("La chaîne Ğ1 n'est pas encore ouverte : ton vote est simulé.", { exact: false })).toHaveCount(1); + const n = before.p.tallySimulated.against + 1; + await expect(fold.getByText(n === 1 ? 'dont 1 simulé' : `dont ${n} simulés`, { exact: true })).toBeVisible(); // Counted at once, marked as simulated. const after = await version(page, title); expect(after.p.myVoteState).toBe('simulated'); diff --git a/web/src/lib/components/VoteFold.svelte b/web/src/lib/components/VoteFold.svelte index 92bbd7d..4c6212f 100644 --- a/web/src/lib/components/VoteFold.svelte +++ b/web/src/lib/components/VoteFold.svelte @@ -133,7 +133,7 @@
-

{t('tally.short', { for: p.tally.for, against: p.tally.against })}

+

{t('tally.short', { for: p.tally.for, against: p.tally.against })}{#if p.tallySimulated?.for || p.tallySimulated?.against} {i18n.plural('vote.tally.simulated', p.tallySimulated.for + p.tallySimulated.against)}{/if}

{#if p.evaluation}

{t('tally.required', { n: p.evaluation.required })}

{p.evaluation.reached ? t('tally.reached') : i18n.plural('tally.missing', p.evaluation.missing)}

@@ -186,8 +186,8 @@ {/if} {#if p.myVoteStale}

{t('vote.stale')}

- {:else if p.myVote} -

{t(p.myVote === 'for' ? 'vote.mine.for' : 'vote.mine.against')} · {t(p.myVoteChain ? 'vote.mine.chain' : 'vote.mine.saved')}

+ {:else if p.myVote && p.myVoteState !== 'pending'} +

{t(p.myVote === 'for' ? 'vote.mine.for' : 'vote.mine.against')} · {t(p.myVoteChain ? 'vote.mine.chain' : p.myVoteState === 'simulated' ? 'vote.mine.simulated' : 'vote.mine.saved')}

{:else if ballot?.status !== 'pending'}

{t('vote.mine.none')}

{/if} @@ -215,6 +215,8 @@ {#if chain && access.chain}

{t('vote.chain.note', { amount: g1Amount(access.chain.amount) })}

{t('vote.chain.counts')}

+ {:else if access.simulated} +

{t('vote.simulated.note')}

{/if} {/if}

{t('vote.private')}