mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
Signed-off-by: Wes <wesbillman@users.noreply.github.com> Co-authored-by: Pinky <44b8e82baa6e0e254e0208d68f335c283c94e7b78dd1fa10d5a49d3f13dd0435@sprout-oss.stage.blox.sqprod.co> Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co>
28 lines
778 B
Rust
28 lines
778 B
Rust
#[cfg(test)]
|
|
mod tests {
|
|
use serde_json::json;
|
|
|
|
use crate::models::ChannelInfo;
|
|
|
|
#[test]
|
|
fn channel_info_defaults_is_member_for_legacy_payloads() {
|
|
let channel: ChannelInfo = serde_json::from_value(json!({
|
|
"id": "9a1657ac-f7aa-5db0-b632-d8bbeb6dfb50",
|
|
"name": "general",
|
|
"channel_type": "stream",
|
|
"visibility": "open",
|
|
"description": "General discussion",
|
|
"topic": null,
|
|
"purpose": null,
|
|
"member_count": 3,
|
|
"last_message_at": null,
|
|
"archived_at": null,
|
|
"participants": [],
|
|
"participant_pubkeys": []
|
|
}))
|
|
.expect("legacy payload should deserialize");
|
|
|
|
assert!(channel.is_member);
|
|
}
|
|
}
|