Skip to content

Commit 5098f57

Browse files
committed
Fix check of m.read receipt type
1 parent 60d784b commit 5098f57

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

tests/csapi/apidoc_room_receipts_test.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,16 @@ func TestRoomReceipts(t *testing.T) {
6464
t,
6565
client.SyncReq{Since: sinceToken},
6666
client.SyncEphemeralHas(roomID, func(r gjson.Result) bool {
67-
if r.Get("type").Str != "m.read" {
67+
// Check that this is a m.receipt ephemeral event.
68+
if r.Get("type").Str != "m.receipt" {
6869
return false
6970
}
7071

72+
// Check that the receipt type is "m.read".
73+
if !r.Get(`content.*.m\.read`).Exists() {
74+
t.Fatalf("Receipt was not of type 'm.read'")
75+
}
76+
7177
// Ensure that the `room_id` field does NOT exist.
7278
if r.Get("room_id").Exists() {
7379
t.Fatalf("Read receipt included `room_id` field down sync: %s", r.Raw)

0 commit comments

Comments
 (0)