Lot U3 : les tests d'abord, rouges sur 590ccd7 — e2e C39 à C43 (5 / 5 rouges : le chapitre « Info ouverture doc de réf. » absent, « Proposition seed », le mot pour qui n'est pas invité absent, une poignée tirée sur trois lignes s'arrête en place 2, les informations de fonctionnement absentes) ; vitest opening.test.ts (lib/opening absent) et rules.test.ts (25 rouges : les mots d'Yvv, « Proposition d'amorce », le terme défini « participation habituelle », chaque phrase de règle épinglée avec le test qui la prouve) ; Rust the_view_keeps_which_versions_the_seed_put_forward_once_they_enter_into_force (seedFeatured absent de la vue)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Yvv
2026-11-03 22:28:32 +01:00
co-authored by Claude Opus 5.5
parent 590ccd7267
commit 9d478d668a
4 changed files with 573 additions and 0 deletions
+45
View File
@@ -727,3 +727,48 @@ async fn a_seed_proposal_enters_by_the_vote_in_the_test_group() {
.expect("adoption");
assert_eq!(electorate, 16);
}
/// Lot U3 (Yvv, 2026-11-03: « un petit chapitre qui explicite les réglages initiaux de l'auteur,
/// notamment Quorum et Inertie »): the chapter « Info ouverture doc de réf. » says at which level
/// the Propositions d'amorce opened, read in the data of the document. Once one has entered into
/// force it is no longer a seed proposal (`seedProposal`), but the view still says the seed put
/// it forward (`seedFeatured`): its level at the opening stays readable, and it is never counted
/// among the other articles.
#[tokio::test]
async fn the_view_keeps_which_versions_the_seed_put_forward_once_they_enter_into_force() {
let state = fresh().await;
let mut a = Client::of(&state);
a.login("Yvv", false).await;
for group in GROUPS {
let doc = a.doc(group).await;
let featured: Vec<&str> = doc["units"]
.as_array()
.expect("units")
.iter()
.filter(|u| {
std::iter::once(&u["inForce"])
.chain(u["proposals"].as_array().expect("p").iter())
.any(|v| v["seedFeatured"].as_bool() == Some(true))
})
.filter_map(|u| u["code"].as_str())
.collect();
assert_eq!(featured, ["I1", "E1", "E12", "E2"], "{group}");
// Every version says it, true or false; the modules were never put forward.
for v in versions(&doc) {
let seeded = v["seedFeatured"].as_bool().unwrap_or_else(|| panic!("{group}: {v}"));
assert_eq!(seeded, v["seedProposal"].as_bool() == Some(true), "{group}: {}", v["title"]);
}
}
// Into force in the test group, by one voice (quorum 1): no longer a seed proposal, still
// put forward by the seed, at the level it opened at.
let doc = a.doc("essai").await;
let i1 = unit(&doc, "I1")["proposals"][0]["id"].as_str().expect("i1").to_owned();
assert_eq!(a.vote(&i1, "for").await["entered"][0]["code"], "I1");
let doc = a.doc("essai").await;
let p = &unit(&doc, "I1")["inForce"];
assert_eq!(p["id"], i1.as_str());
assert_eq!((p["seedProposal"].as_bool(), p["seedFeatured"].as_bool()), (Some(false), Some(true)));
assert_eq!(unit(&doc, "I1")["inertia"], LOW);
assert!(unit(&doc, "I1")["inertiaChanges"].as_array().expect("changes").is_empty());
}