forked from yvv/decision
Lot V, VoteFold (changement minimal autorisé par orch, M6 sans U) : « ton vote » lit myVoteState — simulé au lieu d'enregistré, rien d'enregistré pour une intention en attente ; la note du vote simulé près des boutons ; « dont N simulés » sur les totaux. C34 le vérifie sous l'article, vu rouge puis vert
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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(page.getByRole('dialog', { name: 'Voter avec ton portefeuille Ğ1' })).toHaveCount(0);
|
||||||
await expect(fold.locator('.voted')).toHaveText(/^Ton vote : contre/);
|
await expect(fold.locator('.voted')).toHaveText(/^Ton vote : contre/);
|
||||||
await expect(fold.getByText(`0 pour · ${before.p.tally.against + 1} contre`)).toBeVisible();
|
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.
|
// Counted at once, marked as simulated.
|
||||||
const after = await version(page, title);
|
const after = await version(page, title);
|
||||||
expect(after.p.myVoteState).toBe('simulated');
|
expect(after.p.myVoteState).toBe('simulated');
|
||||||
|
|||||||
@@ -133,7 +133,7 @@
|
|||||||
<div class="level">
|
<div class="level">
|
||||||
<WaterLevel tally={p.tally} evaluation={p.evaluation} blocked={p.blocked} size="large" />
|
<WaterLevel tally={p.tally} evaluation={p.evaluation} blocked={p.blocked} size="large" />
|
||||||
<div class="numbers">
|
<div class="numbers">
|
||||||
<p class="tally">{t('tally.short', { for: p.tally.for, against: p.tally.against })}</p>
|
<p class="tally">{t('tally.short', { for: p.tally.for, against: p.tally.against })}{#if p.tallySimulated?.for || p.tallySimulated?.against} <span class="faint small">{i18n.plural('vote.tally.simulated', p.tallySimulated.for + p.tallySimulated.against)}</span>{/if}</p>
|
||||||
{#if p.evaluation}
|
{#if p.evaluation}
|
||||||
<p class="muted">{t('tally.required', { n: p.evaluation.required })}</p>
|
<p class="muted">{t('tally.required', { n: p.evaluation.required })}</p>
|
||||||
<p class="state">{p.evaluation.reached ? t('tally.reached') : i18n.plural('tally.missing', p.evaluation.missing)}</p>
|
<p class="state">{p.evaluation.reached ? t('tally.reached') : i18n.plural('tally.missing', p.evaluation.missing)}</p>
|
||||||
@@ -186,8 +186,8 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{#if p.myVoteStale}
|
{#if p.myVoteStale}
|
||||||
<p class="warn">{t('vote.stale')}</p>
|
<p class="warn">{t('vote.stale')}</p>
|
||||||
{:else if p.myVote}
|
{:else if p.myVote && p.myVoteState !== 'pending'}
|
||||||
<p class="voted {p.myVote}">{t(p.myVote === 'for' ? 'vote.mine.for' : 'vote.mine.against')} · <span class="how">{t(p.myVoteChain ? 'vote.mine.chain' : 'vote.mine.saved')}</span></p>
|
<p class="voted {p.myVote}">{t(p.myVote === 'for' ? 'vote.mine.for' : 'vote.mine.against')} · <span class="how">{t(p.myVoteChain ? 'vote.mine.chain' : p.myVoteState === 'simulated' ? 'vote.mine.simulated' : 'vote.mine.saved')}</span></p>
|
||||||
{:else if ballot?.status !== 'pending'}
|
{:else if ballot?.status !== 'pending'}
|
||||||
<p class="muted">{t('vote.mine.none')}</p>
|
<p class="muted">{t('vote.mine.none')}</p>
|
||||||
{/if}
|
{/if}
|
||||||
@@ -215,6 +215,8 @@
|
|||||||
{#if chain && access.chain}
|
{#if chain && access.chain}
|
||||||
<p class="faint small">{t('vote.chain.note', { amount: g1Amount(access.chain.amount) })}</p>
|
<p class="faint small">{t('vote.chain.note', { amount: g1Amount(access.chain.amount) })}</p>
|
||||||
<p class="faint small">{t('vote.chain.counts')}</p>
|
<p class="faint small">{t('vote.chain.counts')}</p>
|
||||||
|
{:else if access.simulated}
|
||||||
|
<p class="faint small">{t('vote.simulated.note')}</p>
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
<p class="faint small">{t('vote.private')}</p>
|
<p class="faint small">{t('vote.private')}</p>
|
||||||
|
|||||||
Reference in New Issue
Block a user