Fix existing tests

This commit is contained in:
David Robertson 2023-06-16 10:57:31 +01:00
parent cf21e5b072
commit cd62d3ea84
No known key found for this signature in database
GPG Key ID: 903ECE108A39DEDD
4 changed files with 15 additions and 3 deletions

View File

@ -16,6 +16,8 @@ func TestLiveAccountDataAggregation(t *testing.T) {
ext := &AccountDataRequest{
Core: Core{
Enabled: &boolTrue,
Lists: []string{"*"},
Rooms: []string{"*"},
},
}
var res Response

View File

@ -90,6 +90,8 @@ func TestExtension_ApplyDelta(t *testing.T) {
AccountData: &AccountDataRequest{
Core: Core{
Enabled: &boolTrue,
Lists: []string{"*"},
Rooms: []string{"*"},
},
},
},

View File

@ -16,10 +16,14 @@ func TestLiveReceiptsAggregation(t *testing.T) {
ext := &ReceiptsRequest{
Core: Core{
Enabled: &boolTrue,
Lists: []string{"*"},
Rooms: []string{"*"},
},
}
var res Response
var extCtx Context
extCtx := Context{
AllSubscribedRooms: []string{roomA, roomB},
}
receiptA1 := &caches.ReceiptUpdate{
Receipt: internal.Receipt{
RoomID: roomA,

View File

@ -16,10 +16,14 @@ func TestLiveTypingAggregation(t *testing.T) {
ext := &TypingRequest{
Core: Core{
Enabled: &boolTrue,
Lists: []string{"*"},
Rooms: []string{"*"},
},
}
var res Response
var extCtx Context
extCtx := Context{
AllSubscribedRooms: []string{roomA, roomB, roomC},
}
typingA1 := &caches.TypingUpdate{
RoomUpdate: &dummyRoomUpdate{
roomID: roomA,
@ -83,6 +87,6 @@ func TestLiveTypingAggregation(t *testing.T) {
ext.AppendLive(ctx, &res, extCtx, eventC1)
want[roomC] = eventC1.GlobalRoomMetadata().TypingEvent
if !reflect.DeepEqual(res.Typing.Rooms, want) {
t.Fatalf("got %+v\nwant %+v", res.Typing.Rooms, want)
t.Fatalf("got %s\nwant %s", res.Typing.Rooms, want)
}
}