mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-02-15 18:12:57 -05:00
test(crypto): Test that we're now notifying when we receive a /keys/query
This commit is contained in:
@@ -835,6 +835,8 @@ pub(crate) mod testing {
|
||||
|
||||
#[cfg(test)]
|
||||
pub(crate) mod tests {
|
||||
use std::time::Duration;
|
||||
|
||||
use matrix_sdk_test::async_test;
|
||||
use ruma::device_id;
|
||||
|
||||
@@ -853,8 +855,14 @@ pub(crate) mod tests {
|
||||
let devices = manager.store.get_user_devices(other_user).await.unwrap();
|
||||
assert_eq!(devices.devices().count(), 0);
|
||||
|
||||
let listener = manager.listen_for_received_queries();
|
||||
|
||||
let task = tokio::task::spawn(async move { listener.wait(Duration::from_secs(10)).await });
|
||||
|
||||
manager.receive_keys_query_response(&other_key_query()).await.unwrap();
|
||||
|
||||
assert!(task.await.unwrap().is_ok());
|
||||
|
||||
let devices = manager.store.get_user_devices(other_user).await.unwrap();
|
||||
assert_eq!(devices.devices().count(), 1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user