//! Invariant: `envseal_store` rejects a whitespace-only secret value.
//!
//! An empty-looking value (spaces, tabs, newlines) is almost certainly a
//! misconfiguration. Storing it would silently produce an unusable secret.

#[tokio::test]
async fn rejects_whitespace_only_value() {
    let result = envseal_mcp::tools::store::execute(envseal_mcp::tools::store::StoreParams {
        name: "my-secret".to_string(),
        value: "   ".to_string(),
        force: false,
    })
    .await;

    let err = result.expect_err("expected whitespace-only value to be rejected");
    assert!(
        err.contains("value must not be empty"),
        "unexpected error: {err}"
    );
}

#[tokio::test]
async fn rejects_tab_only_value() {
    let result = envseal_mcp::tools::store::execute(envseal_mcp::tools::store::StoreParams {
        name: "my-secret".to_string(),
        value: "\t\t".to_string(),
        force: false,
    })
    .await;

    let err = result.expect_err("expected tab-only value to be rejected");
    assert!(
        err.contains("value must not be empty"),
        "unexpected error: {err}"
    );
}
