mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-12 05:15:00 +00:00
Fix channel test ordering
This commit is contained in:
parent
9cc55f895c
commit
2456c077f6
1 changed files with 23 additions and 10 deletions
|
@ -281,10 +281,12 @@ async fn test_channel_invites(db: &Arc<Database>) {
|
||||||
|
|
||||||
assert_eq!(user_3_invites, &[channel_1_1]);
|
assert_eq!(user_3_invites, &[channel_1_1]);
|
||||||
|
|
||||||
let members = db
|
let mut members = db
|
||||||
.get_channel_participant_details(channel_1_1, user_1)
|
.get_channel_participant_details(channel_1_1, user_1)
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
members.sort_by_key(|member| member.user_id);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
members,
|
members,
|
||||||
&[
|
&[
|
||||||
|
@ -293,16 +295,16 @@ async fn test_channel_invites(db: &Arc<Database>) {
|
||||||
kind: proto::channel_member::Kind::Member.into(),
|
kind: proto::channel_member::Kind::Member.into(),
|
||||||
role: proto::ChannelRole::Admin.into(),
|
role: proto::ChannelRole::Admin.into(),
|
||||||
},
|
},
|
||||||
proto::ChannelMember {
|
|
||||||
user_id: user_3.to_proto(),
|
|
||||||
kind: proto::channel_member::Kind::Invitee.into(),
|
|
||||||
role: proto::ChannelRole::Admin.into(),
|
|
||||||
},
|
|
||||||
proto::ChannelMember {
|
proto::ChannelMember {
|
||||||
user_id: user_2.to_proto(),
|
user_id: user_2.to_proto(),
|
||||||
kind: proto::channel_member::Kind::Invitee.into(),
|
kind: proto::channel_member::Kind::Invitee.into(),
|
||||||
role: proto::ChannelRole::Member.into(),
|
role: proto::ChannelRole::Member.into(),
|
||||||
},
|
},
|
||||||
|
proto::ChannelMember {
|
||||||
|
user_id: user_3.to_proto(),
|
||||||
|
kind: proto::channel_member::Kind::Invitee.into(),
|
||||||
|
role: proto::ChannelRole::Admin.into(),
|
||||||
|
},
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -857,10 +859,13 @@ async fn test_user_is_channel_participant(db: &Arc<Database>) {
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let members = db
|
let mut members = db
|
||||||
.get_channel_participant_details(vim_channel, admin)
|
.get_channel_participant_details(vim_channel, admin)
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
members.sort_by_key(|member| member.user_id);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
members,
|
members,
|
||||||
&[
|
&[
|
||||||
|
@ -912,11 +917,13 @@ async fn test_user_is_channel_participant(db: &Arc<Database>) {
|
||||||
.await
|
.await
|
||||||
.is_err());
|
.is_err());
|
||||||
|
|
||||||
let members = db
|
let mut members = db
|
||||||
.get_channel_participant_details(vim_channel, admin)
|
.get_channel_participant_details(vim_channel, admin)
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
members.sort_by_key(|member| member.user_id);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
members,
|
members,
|
||||||
&[
|
&[
|
||||||
|
@ -951,10 +958,13 @@ async fn test_user_is_channel_participant(db: &Arc<Database>) {
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
// currently people invited to parent channels are not shown here
|
// currently people invited to parent channels are not shown here
|
||||||
let members = db
|
let mut members = db
|
||||||
.get_channel_participant_details(vim_channel, admin)
|
.get_channel_participant_details(vim_channel, admin)
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
members.sort_by_key(|member| member.user_id);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
members,
|
members,
|
||||||
&[
|
&[
|
||||||
|
@ -996,10 +1006,13 @@ async fn test_user_is_channel_participant(db: &Arc<Database>) {
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let members = db
|
let mut members = db
|
||||||
.get_channel_participant_details(vim_channel, admin)
|
.get_channel_participant_details(vim_channel, admin)
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
members.sort_by_key(|member| member.user_id);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
members,
|
members,
|
||||||
&[
|
&[
|
||||||
|
|
Loading…
Reference in a new issue