v0.3.7-pre.005
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-app-backfill-desk/tests/desktop_contract.rs
|
||||
// version: 4
|
||||
// version: 5
|
||||
|
||||
//! Structural desktop contract checks for the Backfill Desk scaffold.
|
||||
|
||||
@@ -200,3 +200,31 @@ fn pre_004_transport_runtime_builds_pool_and_validates_both_required_rpc_methods
|
||||
let tauri = read_text(root.join("src/tauri.rs").as_path());
|
||||
assert!(tauri.contains("backfill_options"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pre_005_store_readiness_proves_network_before_open_and_closes_on_main_window_exit() {
|
||||
let root = app_root();
|
||||
let store = read_text(root.join("src/store_runtime.rs").as_path());
|
||||
let coherence = store.find("validate_network_coherence(store_network.as_str(), transport_network.as_str())");
|
||||
let open = store.find("ksp_store_lib::Store::open");
|
||||
assert!(coherence.is_some());
|
||||
assert!(open.is_some());
|
||||
if let (std::option::Option::Some(coherence), std::option::Option::Some(open)) = (coherence, open) {
|
||||
assert!(coherence < open, "Store network coherence must be proven before physical Store open");
|
||||
}
|
||||
assert!(store.contains("store.health().await"));
|
||||
assert!(store.contains("store.close().await"));
|
||||
assert!(store.contains("StoreHealthState::Ready"));
|
||||
assert!(store.contains("StoreHealthState::NotReady"));
|
||||
assert!(!store.contains("BackfillJobRuntime"));
|
||||
assert!(!store.contains("BackfillRequest"));
|
||||
let app_state = read_text(root.join("src/app_state.rs").as_path());
|
||||
assert!(app_state.contains("initialize_store"));
|
||||
assert!(app_state.contains("pre.005-store-readiness"));
|
||||
assert!(app_state.contains("composition_ready"));
|
||||
assert!(app_state.contains("close_store"));
|
||||
let tauri = read_text(root.join("src/tauri.rs").as_path());
|
||||
for required in ["on_window_event", "WindowEvent::CloseRequested", "prevent_close", "async_runtime::spawn", "close_store", "app_handle.exit(0)"] {
|
||||
assert!(tauri.contains(required), "missing bounded Store shutdown lifecycle marker {required}");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user