sal-modular/vault/tests/wasm_keypair_management.rs
Sameh Abouelsaad 13945a8725 feat: Add WASM support and browser extension infrastructure
- Add WASM build target and dependencies for all crates.
- Implement IndexedDB-based persistent storage for WASM.
- Create browser extension infrastructure (UI, scripting, etc.).
- Integrate Rhai scripting engine for secure automation.
- Implement user stories and documentation for the extension.
2025-05-16 15:31:53 +03:00

25 lines
992 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("testdb_wasm_keypair_management").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");
}