forked from yvv/decision
- ld-engine inertia::when_everyone_votes_the_share_asked_is_m_on_every_electorate : pour tout W de 1 à 10 000 000, les cinq crans, G aux deux bornes de la participation habituelle, les quorums 1, 2 et W : quand les W votent, la part exigée des T′ = max(W, Q) votants est M, exactement ; la phrase d'avant (« la majorité M suffit », lue ⌈M·W⌉ « pour ») fausse sur 17 couples (W, cran), tous W ≤ 15, une voix de plus (B^W) ; vert sur le moteur inchangé, ses dents vues rouges par trois mutations (le plafond de la participation retiré, B^W mis dans la part, B^W retiré de R). - web/tests/unit/rules.test.ts : formula.reading épinglée en fr, en, es (« la part exigée est la majorité M ») ; aucune chaîne des catalogues ni du texte des composants ne dit que la majorité suffit ; la liste fermée de ce que l'écran dit de la pleine participation (formula.M, formula.reading, settings.reading) ; inertia.test.ts suit. 5 tests rouges sur 116. - tests/amorce.rs the_queue_names_the_starter_proposals_as_the_screen_does : les quatre raisons « Proposition d'amorce réécrite / ajoutée » (I1, E1, E2, E12), dans les constantes et dans les cinq lignes de file que T4 écrit sur une base comme la production après M8 ; celles de M6 inchangées. Rouge sur les constantes, et sur la file quand les constantes sont sautées. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
53 lines
3.4 KiB
TypeScript
53 lines
3.4 KiB
TypeScript
// The five levels of inertia, as the screen names them (ADR 0007).
|
|
import { describe, expect, it } from 'vitest';
|
|
import { en } from '../../src/lib/i18n/en';
|
|
import { es } from '../../src/lib/i18n/es';
|
|
import { fr } from '../../src/lib/i18n/fr';
|
|
import { INERTIA_LEVELS } from '../../src/lib/types';
|
|
|
|
describe('five levels of inertia', () => {
|
|
it('go from 1 to 5, 3 in the middle', () => {
|
|
expect(INERTIA_LEVELS).toEqual([1, 2, 3, 4, 5]);
|
|
});
|
|
it('each level has its own short name, in the three languages', () => {
|
|
expect(INERTIA_LEVELS.map((k) => fr[`inertia.name.${k}`])).toEqual(['très basse', 'basse', 'moyenne', 'haute', 'très haute']);
|
|
expect(INERTIA_LEVELS.map((k) => en[`inertia.name.${k}`])).toEqual(['very low', 'low', 'medium', 'high', 'very high']);
|
|
expect(INERTIA_LEVELS.map((k) => es[`inertia.name.${k}`])).toEqual(['muy baja', 'baja', 'media', 'alta', 'muy alta']);
|
|
});
|
|
it('the threshold is told with the quorum, no longer with C (ADR 0013)', () => {
|
|
const told = [
|
|
'deep.note', 'formula.reading', 'settings.reading', 'settings.share.note',
|
|
'settings.usual.reference.one', 'settings.usual.reference.other',
|
|
] as const;
|
|
for (const cat of [fr, en, es]) {
|
|
for (const k of told) expect(cat[k], k).not.toMatch(/\bC\b/);
|
|
expect(cat['deep.note']).not.toContain('{floor}');
|
|
expect(cat['formula.Q']).toContain('{n}');
|
|
expect(cat['settings.usual.reference.other']).toContain('{q}');
|
|
}
|
|
expect(fr['formula.reading']).toContain('les votants qui manquent comptent comme « non »');
|
|
expect(fr['settings.quorum.note']).toContain('avant le premier vote');
|
|
});
|
|
it('the share asked is highest at the quorum, never near-unanimity because few vote (review of M6b, lot T2)', () => {
|
|
const lowTurnout = /unanimi|peu de gens votent|faible participation|few people vote|low turnout|vota poca gente|poca participación/;
|
|
for (const cat of [fr, en, es]) {
|
|
for (const k of ['inertia.explain', 'formula.reading'] as const) expect(cat[k], k).not.toMatch(lowTurnout);
|
|
// After the act « supprime », or a direct vote withdrawn, the quorum changes again.
|
|
expect(cat['quorum.error.voted']).not.toMatch(/ne change plus|no longer changes|ya no cambia/);
|
|
}
|
|
expect(fr['inertia.explain']).toBe(
|
|
"Plus l'inertie est haute, plus il faut de voix pour changer ce texte. Sous le quorum de l'article, les votants qui manquent comptent comme « non » ; au-delà, la part exigée baisse quand la participation monte.",
|
|
);
|
|
// Lot U3c: « la part exigée est la majorité M », no longer « la majorité M suffit » (rules.test.ts).
|
|
expect(fr['formula.reading']).toBe(
|
|
"Sous le quorum Q de l'article, les votants qui manquent comptent comme « non » : il faut autant de « pour » que si Q personnes avaient voté. Au-delà, la part de « pour » demandée, la plus haute au quorum, baisse quand la participation monte ; quand tout le monde vote, la part exigée est la majorité M.",
|
|
);
|
|
expect(fr['quorum.error.voted']).toBe("Quelqu'un a déjà voté sur cet article : son quorum ne change pas.");
|
|
});
|
|
it('a change of inertia is said to be voted at the level of the article, no longer one above', () => {
|
|
for (const cat of [fr, en, es]) expect(cat['inertia.change.note']).toContain('{level}');
|
|
expect(fr['inertia.change.note']).toContain("à l'inertie de l'article");
|
|
expect(fr['inertia.change.note']).not.toContain('au-dessus');
|
|
});
|
|
});
|