Your browser sucks, JavaScript disabled! Gunnar's console needs JavaScript and WebAssembly. Git over SSH on port 2222 does not.

nordisk/monetize

crates/monetize-server/src/estate_order/tests/gone_estates.rs

//! ★ **OVW-1 (prod 2026-10-29): a finished terminate forgets the estate in the fleet's store.**
//! Prod's guardian store kept acme2, ignalina, polka, rickardtest and test3-holger-rs in its
//! ESTATES for ever after their terminates: the terminate forgot their boxes, never the
//! estate. Now its fleet row, its unacked orders and its auto-fix opt-in go with its boxes;
//! the run stays (the buyer's "terminated" page and the Overview's quiet line read it).

use super::*;

#[test]
fn a_finished_terminate_forgets_the_estates_fleet_row() {
    let r = delivered_acme("ovw1-forget");
    let g = r.state.fleet.guardian().unwrap();
    g.store.declare("acme", "gunnar").unwrap();
    g.store.set_auto_fix("acme", true).unwrap();
    g.store.declare("bolt", "gunnar").unwrap();
    terminate::terminate(&r.state, None, "acme", "acme.gunnar.rs").expect("asked");
    drive(&r.state, "acme");
    assert_eq!(
        r.state.estates.get("acme").unwrap().phase,
        phase::TERMINATED
    );
    assert_eq!(
        g.store.product_of("acme"),
        None,
        "the fleet's row of the estate is forgotten"
    );
    let names: Vec<String> = g.store.estates().into_iter().map(|(i, _)| i).collect();
    assert_eq!(names, ["bolt"], "only the terminated estate is forgotten");
    assert!(
        !g.store.auto_fix("acme"),
        "its auto-fix opt-in goes with it"
    );
    // The run stays: the Overview's quiet line says when it ended; no row.
    let o = standing::overview(&r.state);
    assert!(o.estates.iter().all(|l| l.name != "acme"), "{o:#?}");
    assert!(
        o.ended
            .iter()
            .any(|l| l.name == "acme" && l.standing == "ended" && !l.in_fleet),
        "{o:#?}"
    );
}