Change position of GroupsV2 leave update message.

This commit is contained in:
Alan Evans
2020-07-24 16:27:39 -03:00
committed by Greyson Parrelli
parent 8cb9ab3204
commit 745a7f76ea
2 changed files with 46 additions and 2 deletions

View File

@@ -767,6 +767,30 @@ public final class GroupsV2UpdateMessageProducerTest {
"Alice changed who can edit group membership to \"All members\".")));
}
@Test
public void multiple_changes_leave_and_promote() {
DecryptedGroupChange change = changeBy(alice)
.deleteMember(alice)
.promoteToAdmin(bob)
.build();
assertThat(describeChange(change), is(Arrays.asList(
"Alice made Bob an admin.",
"Alice left the group.")));
}
@Test
public void multiple_changes_leave_and_promote_by_unknown() {
DecryptedGroupChange change = changeByUnknown()
.deleteMember(alice)
.promoteToAdmin(bob)
.build();
assertThat(describeChange(change), is(Arrays.asList(
"Bob is now an admin.",
"Alice is no longer in the group.")));
}
@Test
public void multiple_changes_by_unknown() {
DecryptedGroupChange change = changeByUnknown()
@@ -785,6 +809,22 @@ public final class GroupsV2UpdateMessageProducerTest {
"Who can edit group membership has been changed to \"All members\".")));
}
@Test
public void multiple_changes_join_and_leave_by_unknown() {
DecryptedGroupChange change = changeByUnknown()
.addMember(alice)
.promoteToAdmin(alice)
.deleteMember(alice)
.title("Updated title")
.build();
assertThat(describeChange(change), is(Arrays.asList(
"Alice joined the group.",
"Alice is now an admin.",
"The group name has changed to \"Updated title\".",
"Alice is no longer in the group.")));
}
// Group state without a change record
@Test