mirror of
https://github.com/matrix-org/sliding-sync.git
synced 2025-03-10 13:37:11 +00:00
Add avatar regression test
This commit is contained in:
parent
ef2aa0a521
commit
8d300dc206
@ -1713,7 +1713,6 @@ func TestAvatarFieldInRoomResponse(t *testing.T) {
|
||||
}
|
||||
return m.MatchRoomAvatar(bob.AvatarURL)(r)
|
||||
}))
|
||||
|
||||
})
|
||||
|
||||
t.Run("See avatar when invited", func(t *testing.T) {
|
||||
@ -1731,3 +1730,30 @@ func TestAvatarFieldInRoomResponse(t *testing.T) {
|
||||
m.MatchResponse(t, res, m.MatchRoomSubscription(dmInvited, m.MatchRoomAvatar(chris.AvatarURL)))
|
||||
})
|
||||
}
|
||||
|
||||
// Regression test for https://github.com/element-hq/element-x-ios/issues/2003
|
||||
// Ensure that a group chat with 1 other person has no avatar field set. Only DMs should have this set.
|
||||
func TestAvatarUnsetInTwoPersonRoom(t *testing.T) {
|
||||
alice := registerNamedUser(t, "alice")
|
||||
bob := registerNamedUser(t, "bob")
|
||||
roomID := alice.MustCreateRoom(t, map[string]interface{}{
|
||||
"preset": "trusted_private_chat",
|
||||
"name": "Nice test room",
|
||||
"invite": []string{bob.UserID},
|
||||
})
|
||||
|
||||
res := alice.SlidingSync(t, sync3.Request{
|
||||
Lists: map[string]sync3.RequestList{
|
||||
"a": {
|
||||
Ranges: sync3.SliceRanges{{0, 20}},
|
||||
},
|
||||
},
|
||||
})
|
||||
m.MatchResponse(t, res, m.MatchRoomSubscriptionsStrict(map[string][]m.RoomMatcher{
|
||||
roomID: {
|
||||
m.MatchRoomUnsetAvatar(),
|
||||
m.MatchInviteCount(1),
|
||||
m.MatchRoomName("Nice test room"),
|
||||
},
|
||||
}))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user