From e813134e029185aac6364ddcb3a69e86c7e7fe05 Mon Sep 17 00:00:00 2001 From: Toni Spets Date: Mon, 26 Feb 2024 10:52:14 +0200 Subject: [PATCH] Attempt to properly fix room create with version --- tests/csapi/apidoc_room_create_test.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/csapi/apidoc_room_create_test.go b/tests/csapi/apidoc_room_create_test.go index 813e7da6..152a1c18 100644 --- a/tests/csapi/apidoc_room_create_test.go +++ b/tests/csapi/apidoc_room_create_test.go @@ -179,7 +179,7 @@ func TestRoomCreate(t *testing.T) { alice.MustSyncUntil(t, client.SyncReq{}, client.SyncJoinedTo(alice.UserID, roomID)) // Get ordered timeline via a full sync - res, _ := alice.MustSync(t, client.SyncReq{Filter: `{"room":{"timeline":{"limit":20}}}`}) + res, _ := alice.MustSync(t, client.SyncReq{}) roomObj := res.Get("rooms.join." + client.GjsonEscape(roomID)) @@ -187,10 +187,13 @@ func TestRoomCreate(t *testing.T) { t.Fatalf("Room did not appear in sync") } - event0 := roomObj.Get("timeline.events.0") + event0 := roomObj.Get(`timeline.events.#(type=="m.room.create")`) if !event0.Exists() { - t.Fatalf("First timeline event does not exist") + event0 = roomObj.Get(`state.events.#(type=="m.room.create")`) + } + if !event0.Exists() { + t.Fatalf("Room create event does not exist") } if event0.Get("type").Str != "m.room.create" {