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')}