artifactize-core 0.27.1

The library behind artifactize: Artifacts, evals, reviews, the monitor and review models, and the shared operations every interface calls.
Documentation
use super::*;
use serde_json::json;

#[test]
fn result_phase_is_the_only_source_of_wire_readiness_and_verdict() {
    let page = |phase| RunResultPage {
        run: "run-wire".parse().unwrap(),
        phase,
        findings: Vec::new(),
        next_cursor: None,
    };
    assert_eq!(
        serde_json::to_value(page(ResultState::Running)).unwrap(),
        json!({
            "run":"run-wire","state":"running","ready":false,"verdict":null,
            "satisfied":false,"findings":[],"next_cursor":null,
        })
    );
    assert_eq!(
        serde_json::to_value(page(ResultState::Green { satisfied: true })).unwrap(),
        json!({
            "run":"run-wire","state":"green","ready":true,"verdict":"GREEN",
            "satisfied":true,"findings":[],"next_cursor":null,
        })
    );
    let red = serde_json::to_value(page(ResultState::Red)).unwrap();
    assert_eq!(red["verdict"], "RED");
    assert_eq!(red["ready"], true);
    assert_eq!(red["satisfied"], false);
}