Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mchenani committed Dec 17, 2024
1 parent 7cdf654 commit e02b70b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions bindings_ffi/src/mls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2091,6 +2091,9 @@ mod tests {
.await
.unwrap();

let conn = client.inner_client.context().store().conn().unwrap();
conn.register_triggers();

register_client(&ffi_inbox_owner, &client).await;
client
}
Expand Down Expand Up @@ -2572,6 +2575,8 @@ mod tests {
async fn test_can_stream_group_messages_for_updates() {
let alix = new_test_client().await;
let bo = new_test_client().await;
let alix_provider = alix.inner_client.mls_provider().unwrap();
let bo_provider = bo.inner_client.mls_provider().unwrap();

// Stream all group messages
let message_callbacks = Arc::new(RustStreamCallback::default());
Expand Down Expand Up @@ -2604,21 +2609,29 @@ mod tests {
.unwrap();
let bo_group = &bo_groups[0];
bo_group.sync().await.unwrap();

// alix published + processed group creation and name update
assert_eq!(alix_provider.conn_ref().intents_published(), 2);
assert_eq!(alix_provider.conn_ref().intents_deleted(), 2);

bo_group
.update_group_name("Old Name2".to_string())
.await
.unwrap();
message_callbacks.wait_for_delivery(None).await.unwrap();
assert_eq!(bo_provider.conn_ref().intents_published(), 1);

alix_group.send(b"Hello there".to_vec()).await.unwrap();
message_callbacks.wait_for_delivery(None).await.unwrap();
assert_eq!(alix_provider.conn_ref().intents_published(), 3);

let dm = bo
.conversations()
.create_dm(alix.account_address.clone())
.await
.unwrap();
dm.send(b"Hello again".to_vec()).await.unwrap();
assert_eq!(bo_provider.conn_ref().intents_published(), 3);
message_callbacks.wait_for_delivery(None).await.unwrap();

// Uncomment the following lines to add more group name updates
Expand All @@ -2627,6 +2640,7 @@ mod tests {
.await
.unwrap();
message_callbacks.wait_for_delivery(None).await.unwrap();
assert_eq!(bo_provider.conn_ref().intents_published(), 4);

assert_eq!(message_callbacks.message_count(), 6);

Expand Down

0 comments on commit e02b70b

Please sign in to comment.