Skip to content

Commit

Permalink
fix(sdk): Fix test now that Ruma is fixed
Browse files Browse the repository at this point in the history
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
  • Loading branch information
zecakeh authored and jmartinesp committed Jan 8, 2025
1 parent 47445b1 commit 47c24b9
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions crates/matrix-sdk/src/room/edit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -689,22 +689,13 @@ mod tests {
assert!(image.caption().is_none());
assert!(image.formatted_caption().is_none());

// The raw event doesn't contain the mention :(
// TODO: this is a bug in Ruma! When Ruma gets upgraded in the SDK, this test
// may start failing. In this case, remove the following code, and replace it
// with the commented code below.

assert_matches!(msg.mentions, None);

/*
// The raw event contains the mention.
assert_let!(Some(mentions) = msg.mentions);
assert!(!mentions.room);
assert_eq!(
mentions.user_ids.into_iter().collect::<Vec<_>>(),
vec![mentioned_user_id.clone()]
);
*/
// The raw event contains the mention.
assert_let!(Some(mentions) = msg.mentions);
assert!(!mentions.room);
assert_eq!(
mentions.user_ids.into_iter().collect::<Vec<_>>(),
vec![mentioned_user_id.clone()]
);

assert_let!(Some(Relation::Replacement(repl)) = msg.relates_to);
assert_let!(MessageType::Image(new_image) = repl.new_content.msgtype);
Expand Down

0 comments on commit 47c24b9

Please sign in to comment.