Fix some tests

This commit is contained in:
Conrad Irwin 2023-10-17 10:15:20 -06:00
parent 2456c077f6
commit 3412becfc5
2 changed files with 10 additions and 9 deletions

View file

@ -18,12 +18,12 @@ fn test_update_channels(cx: &mut AppContext) {
proto::Channel {
id: 1,
name: "b".to_string(),
visibility: proto::ChannelVisibility::ChannelMembers as i32,
visibility: proto::ChannelVisibility::Members as i32,
},
proto::Channel {
id: 2,
name: "a".to_string(),
visibility: proto::ChannelVisibility::ChannelMembers as i32,
visibility: proto::ChannelVisibility::Members as i32,
},
],
channel_permissions: vec![proto::ChannelPermission {
@ -51,12 +51,12 @@ fn test_update_channels(cx: &mut AppContext) {
proto::Channel {
id: 3,
name: "x".to_string(),
visibility: proto::ChannelVisibility::ChannelMembers as i32,
visibility: proto::ChannelVisibility::Members as i32,
},
proto::Channel {
id: 4,
name: "y".to_string(),
visibility: proto::ChannelVisibility::ChannelMembers as i32,
visibility: proto::ChannelVisibility::Members as i32,
},
],
insert_edge: vec![
@ -96,17 +96,17 @@ fn test_dangling_channel_paths(cx: &mut AppContext) {
proto::Channel {
id: 0,
name: "a".to_string(),
visibility: proto::ChannelVisibility::ChannelMembers as i32,
visibility: proto::ChannelVisibility::Members as i32,
},
proto::Channel {
id: 1,
name: "b".to_string(),
visibility: proto::ChannelVisibility::ChannelMembers as i32,
visibility: proto::ChannelVisibility::Members as i32,
},
proto::Channel {
id: 2,
name: "c".to_string(),
visibility: proto::ChannelVisibility::ChannelMembers as i32,
visibility: proto::ChannelVisibility::Members as i32,
},
],
insert_edge: vec![
@ -165,7 +165,7 @@ async fn test_channel_messages(cx: &mut TestAppContext) {
channels: vec![proto::Channel {
id: channel_id,
name: "the-channel".to_string(),
visibility: proto::ChannelVisibility::ChannelMembers as i32,
visibility: proto::ChannelVisibility::Members as i32,
}],
..Default::default()
});

View file

@ -143,7 +143,8 @@ impl Database {
channel_id: ActiveValue::Set(channel_id_to_join),
user_id: ActiveValue::Set(user_id),
accepted: ActiveValue::Set(true),
role: ActiveValue::Set(ChannelRole::Guest),
// TODO: change this back to Guest.
role: ActiveValue::Set(ChannelRole::Member),
})
.exec(&*tx)
.await?;