v0.2.12-pre.005

This commit is contained in:
2026-08-27 10:43:01 +02:00
parent 5ac2197b6e
commit 9d351dd1c3
14 changed files with 486 additions and 45 deletions

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-app-solprices-desk/tests/desktop_security.rs
// version: 3
// version: 4
//! Security, ownership and frontend instrumentation canaries for SOL Prices Desk.
@@ -69,7 +69,7 @@ fn pre_002_frontend_has_no_network_persistence_or_native_dialog_surface() {
}
#[test]
fn pre_004_tauri_commands_remain_centralized_and_refresh_is_absent() {
fn pre_005_tauri_commands_remain_centralized_and_only_single_refresh_is_present() {
let root = app_root();
let mut rust_files = std::vec::Vec::new();
collect_files(root.join("src").as_path(), "rs", &mut rust_files);
@@ -82,13 +82,19 @@ fn pre_004_tauri_commands_remain_centralized_and_refresh_is_absent() {
} else {
assert_eq!(count, 0, "{} declares a Tauri command outside tauri.rs", path.display());
}
assert!(!source.contains("refresh_market_price"), "{} advances refresh commands before their planned tranche", path.display());
if path.file_name().and_then(std::ffi::OsStr::to_str) != std::option::Option::Some("tauri.rs") {
assert!(!source.contains("refresh_market_price"), "{} declares refresh command plumbing outside tauri.rs", path.display());
}
assert!(!source.contains("refresh_market_prices"), "{} advances multi-refresh before pre.006", path.display());
assert!(!source.contains("refresh_all_market_prices"), "{} advances global refresh before pre.006", path.display());
}
assert_eq!(command_count, 4);
assert_eq!(command_count, 5);
let tauri = read_text(root.join("src/tauri.rs").as_path());
assert!(tauri.contains("refresh_market_price"));
}
#[test]
fn pre_004_frontend_registry_loading_is_logged_without_business_values() {
fn pre_005_frontend_refresh_interactions_are_logged_without_business_values() {
let root = app_root();
let main = read_text(root.join("frontend/ts/main.ts").as_path());
let invoke = read_text(root.join("frontend/ts/invoke.ts").as_path());
@@ -101,6 +107,9 @@ fn pre_004_frontend_registry_loading_is_logged_without_business_values() {
assert!(invoke.contains("frontendTrace"));
assert!(main.contains("SOL Prices Desk provider registry load started"));
assert!(main.contains("SOL Prices Desk market-price registry rows rendered"));
assert!(main.contains("SOL Prices Desk market-price refresh control clicked"));
assert!(main.contains("SOL Prices Desk market-price refresh row applied"));
assert!(main.contains("SOL Prices Desk market-price refresh failed"));
for forbidden in ["JSON.stringify(status)", "JSON.stringify(payload)", "apiKey", "authorization"] {
assert!(!main.contains(forbidden), "main frontend logging must not serialize business/secret values: {forbidden}");
}