diff --git a/tests/msc2716_test.go b/tests/msc2716_test.go index 83bdbb28..fb0b659c 100644 --- a/tests/msc2716_test.go +++ b/tests/msc2716_test.go @@ -45,6 +45,12 @@ var ( markerInsertionContentField = "org.matrix.msc2716.marker.insertion" ) +var createRoomOpts = map[string]interface{}{ + "preset": "public_chat", + "name": "the hangout spot", + "room_version": "org.matrix.msc2716", +} + func TestBackfillingHistory(t *testing.T) { deployment := Deploy(t, b.BlueprintHSWithApplicationService) defer deployment.Destroy(t) @@ -75,10 +81,7 @@ func TestBackfillingHistory(t *testing.T) { t.Run("Backfilled historical events resolve with proper state in correct order", func(t *testing.T) { t.Parallel() - roomID := as.CreateRoom(t, map[string]interface{}{ - "preset": "public_chat", - "name": "the hangout spot", - }) + roomID := as.CreateRoom(t, createRoomOpts) alice.JoinRoom(t, roomID, nil) // Create some normal messages in the timeline. We're creating them in @@ -189,10 +192,7 @@ func TestBackfillingHistory(t *testing.T) { t.Run("Backfilled historical events from multiple users in the same chunk", func(t *testing.T) { t.Parallel() - roomID := as.CreateRoom(t, map[string]interface{}{ - "preset": "public_chat", - "name": "the hangout spot", - }) + roomID := as.CreateRoom(t, createRoomOpts) alice.JoinRoom(t, roomID, nil) // Create the "live" event we are going to insert our backfilled events next to @@ -239,10 +239,7 @@ func TestBackfillingHistory(t *testing.T) { t.Run("Backfilled historical events with m.historical do not come down in an incremental sync", func(t *testing.T) { t.Parallel() - roomID := as.CreateRoom(t, map[string]interface{}{ - "preset": "public_chat", - "name": "the hangout spot", - }) + roomID := as.CreateRoom(t, createRoomOpts) alice.JoinRoom(t, roomID, nil) // Create the "live" event we are going to insert our backfilled events next to @@ -289,10 +286,7 @@ func TestBackfillingHistory(t *testing.T) { t.Run("Unrecognised prev_event ID will throw an error", func(t *testing.T) { t.Parallel() - roomID := as.CreateRoom(t, map[string]interface{}{ - "preset": "public_chat", - "name": "the hangout spot", - }) + roomID := as.CreateRoom(t, createRoomOpts) batchSendHistoricalMessages( t, @@ -314,10 +308,7 @@ func TestBackfillingHistory(t *testing.T) { t.Run("Normal users aren't allowed to backfill messages", func(t *testing.T) { t.Parallel() - roomID := as.CreateRoom(t, map[string]interface{}{ - "preset": "public_chat", - "name": "the hangout spot", - }) + roomID := as.CreateRoom(t, createRoomOpts) alice.JoinRoom(t, roomID, nil) eventIDsBefore := createMessagesInRoom(t, alice, roomID, 1) @@ -348,10 +339,7 @@ func TestBackfillingHistory(t *testing.T) { t.Skip("Skipping until federation is implemented") t.Parallel() - roomID := as.CreateRoom(t, map[string]interface{}{ - "preset": "public_chat", - "name": "the hangout spot", - }) + roomID := as.CreateRoom(t, createRoomOpts) alice.JoinRoom(t, roomID, nil) eventIDsBefore := createMessagesInRoom(t, alice, roomID, 1) @@ -406,10 +394,7 @@ func TestBackfillingHistory(t *testing.T) { t.Skip("Skipping until federation is implemented") t.Parallel() - roomID := as.CreateRoom(t, map[string]interface{}{ - "preset": "public_chat", - "name": "the hangout spot", - }) + roomID := as.CreateRoom(t, createRoomOpts) alice.JoinRoom(t, roomID, nil) eventIDsBefore := createMessagesInRoom(t, alice, roomID, 1) @@ -482,10 +467,7 @@ func TestBackfillingHistory(t *testing.T) { t.Skip("Skipping until federation is implemented") t.Parallel() - roomID := as.CreateRoom(t, map[string]interface{}{ - "preset": "public_chat", - "name": "the hangout spot", - }) + roomID := as.CreateRoom(t, createRoomOpts) alice.JoinRoom(t, roomID, nil) // Join the room from a remote homeserver before any backfilled messages are sent @@ -589,10 +571,7 @@ func TestBackfillingHistory(t *testing.T) { t.Skip("Skipping until federation is implemented") t.Parallel() - roomID := as.CreateRoom(t, map[string]interface{}{ - "preset": "public_chat", - "name": "the hangout spot", - }) + roomID := as.CreateRoom(t, createRoomOpts) alice.JoinRoom(t, roomID, nil) // Join the room from a remote homeserver before any backfilled messages are sent