cryptpo: Add test that the account is updated correctly in the store.
This commit is contained in:
parent
06722635e7
commit
6efd216f35
1 changed files with 24 additions and 0 deletions
|
@ -240,4 +240,28 @@ mod test {
|
|||
|
||||
assert_eq!(*acc, loaded_account);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn save_and_share_account() {
|
||||
let mut store = get_store().await;
|
||||
let account = get_account();
|
||||
|
||||
store
|
||||
.save_account(account.clone())
|
||||
.await
|
||||
.expect("Can't save account");
|
||||
|
||||
account.lock().await.shared = true;
|
||||
|
||||
store
|
||||
.save_account(account.clone())
|
||||
.await
|
||||
.expect("Can't save account");
|
||||
|
||||
let loaded_account = store.load_account().await.expect("Can't load account");
|
||||
let loaded_account = loaded_account.unwrap();
|
||||
let acc = account.lock().await;
|
||||
|
||||
assert_eq!(*acc, loaded_account);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue