mirror of
https://github.com/matrix-org/sliding-sync.git
synced 2025-03-10 13:37:11 +00:00
Add regression test
This commit is contained in:
parent
e295c31ab7
commit
451f6fb9c8
@ -235,6 +235,32 @@ func TestExtensionE2EE(t *testing.T) {
|
|||||||
})
|
})
|
||||||
m.MatchResponse(t, res, m.MatchDeviceLists(wantChanged, wantLeft))
|
m.MatchResponse(t, res, m.MatchDeviceLists(wantChanged, wantLeft))
|
||||||
|
|
||||||
|
// check that empty lists aren't serialised as null
|
||||||
|
v2.queueResponse(alice, sync2.SyncResponse{
|
||||||
|
DeviceLists: struct {
|
||||||
|
Changed []string `json:"changed,omitempty"`
|
||||||
|
Left []string `json:"left,omitempty"`
|
||||||
|
}{
|
||||||
|
Changed: wantChanged,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
v2.waitUntilEmpty(t, alice)
|
||||||
|
res = v3.mustDoV3RequestWithPos(t, aliceToken, res.Pos, sync3.Request{
|
||||||
|
Lists: map[string]sync3.RequestList{"a": {
|
||||||
|
Ranges: sync3.SliceRanges{
|
||||||
|
[2]int64{0, 10}, // doesn't matter
|
||||||
|
},
|
||||||
|
}},
|
||||||
|
// enable the E2EE extension
|
||||||
|
Extensions: extensions.Request{
|
||||||
|
E2EE: &extensions.E2EERequest{
|
||||||
|
Core: extensions.Core{Enabled: &boolTrue},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
if res.Extensions.E2EE.DeviceLists.Left == nil {
|
||||||
|
t.Errorf("left array should be [] not null")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Checks that to-device messages are passed from v2 to v3
|
// Checks that to-device messages are passed from v2 to v3
|
||||||
|
Loading…
x
Reference in New Issue
Block a user