Skip to content

Commit 1a5132f

Browse files
committed
Add a test that it's not possible to change an InBroadcastChannel
1 parent 551d002 commit 1a5132f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/chat/chat_tests.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2705,6 +2705,7 @@ async fn test_broadcast_channels() -> Result<()> {
27052705
let rcvd = bob.recv_msg(&sent).await;
27062706
assert_eq!(rcvd.get_info_type(), SystemMessage::GroupImageChanged);
27072707
assert_eq!(rcvd.text, "Group image changed by alice@example.org.");
2708+
assert_eq!(rcvd.chat_id, bob_chat.id);
27082709

27092710
let bob_chat = Chat::load_from_db(bob, bob_chat.id).await?;
27102711
let avatar = bob_chat.get_profile_image(bob).await?.unwrap();
@@ -2713,6 +2714,14 @@ async fn test_broadcast_channels() -> Result<()> {
27132714
AVATAR_64x64_DEDUPLICATED
27142715
);
27152716

2717+
tcm.section("Check that Bob can't modify the channel");
2718+
set_chat_profile_image(&bob, bob_chat.id, file.to_str().unwrap())
2719+
.await
2720+
.unwrap_err();
2721+
set_chat_name(bob, bob_chat.id, "Bob Channel name")
2722+
.await
2723+
.unwrap_err();
2724+
27162725
Ok(())
27172726
}
27182727

0 commit comments

Comments
 (0)