25 lines
967 B
Rust
25 lines
967 B
Rust
// This file contains WASM-only tests for keypair management in the vault crate.
|
|
// All code is strictly separated from native using cfg attributes.
|
|
#![cfg(target_arch = "wasm32")]
|
|
//! WASM test for keypair management in the vault crate.
|
|
|
|
use wasm_bindgen_test::*;
|
|
use vault::Vault;
|
|
|
|
|
|
wasm_bindgen_test_configure!(run_in_browser);
|
|
|
|
#[wasm_bindgen_test(async)]
|
|
async fn test_keypair_management_and_crypto() {
|
|
// Example: test keypair creation, selection, signing, etc.
|
|
// This is a placeholder for your real test logic.
|
|
// All imports are WASM-specific and local to the test function
|
|
use kvstore::wasm::WasmStore;
|
|
use vault::Vault;
|
|
let store = WasmStore::open("vault").await.unwrap();
|
|
let mut vault = Vault::new(store);
|
|
vault.create_keyspace("testspace", b"pw", None).await.unwrap();
|
|
let key_id = vault.add_keypair("testspace", b"pw", None, None).await.unwrap();
|
|
assert!(!key_id.is_empty(), "Keypair ID should not be empty");
|
|
}
|