Skip to content

Commit fd752eb

Browse files
Adapt MSC2716 implementation to org.matrix.msc2716 experimental room version (#176)
* Use experimental org.matrix.msc2716 room version for MSC2716 tests As introduced in matrix-org/synapse#10245, use experimental `org.matrix.msc2716` room version. * Use shared createRoomOpts
1 parent e9e86d3 commit fd752eb

File tree

1 file changed

+15
-36
lines changed

1 file changed

+15
-36
lines changed

tests/msc2716_test.go

Lines changed: 15 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ var (
4545
markerInsertionContentField = "org.matrix.msc2716.marker.insertion"
4646
)
4747

48+
var createRoomOpts = map[string]interface{}{
49+
"preset": "public_chat",
50+
"name": "the hangout spot",
51+
"room_version": "org.matrix.msc2716",
52+
}
53+
4854
func TestBackfillingHistory(t *testing.T) {
4955
deployment := Deploy(t, b.BlueprintHSWithApplicationService)
5056
defer deployment.Destroy(t)
@@ -75,10 +81,7 @@ func TestBackfillingHistory(t *testing.T) {
7581
t.Run("Backfilled historical events resolve with proper state in correct order", func(t *testing.T) {
7682
t.Parallel()
7783

78-
roomID := as.CreateRoom(t, map[string]interface{}{
79-
"preset": "public_chat",
80-
"name": "the hangout spot",
81-
})
84+
roomID := as.CreateRoom(t, createRoomOpts)
8285
alice.JoinRoom(t, roomID, nil)
8386

8487
// Create some normal messages in the timeline. We're creating them in
@@ -189,10 +192,7 @@ func TestBackfillingHistory(t *testing.T) {
189192
t.Run("Backfilled historical events from multiple users in the same chunk", func(t *testing.T) {
190193
t.Parallel()
191194

192-
roomID := as.CreateRoom(t, map[string]interface{}{
193-
"preset": "public_chat",
194-
"name": "the hangout spot",
195-
})
195+
roomID := as.CreateRoom(t, createRoomOpts)
196196
alice.JoinRoom(t, roomID, nil)
197197

198198
// Create the "live" event we are going to insert our backfilled events next to
@@ -239,10 +239,7 @@ func TestBackfillingHistory(t *testing.T) {
239239
t.Run("Backfilled historical events with m.historical do not come down in an incremental sync", func(t *testing.T) {
240240
t.Parallel()
241241

242-
roomID := as.CreateRoom(t, map[string]interface{}{
243-
"preset": "public_chat",
244-
"name": "the hangout spot",
245-
})
242+
roomID := as.CreateRoom(t, createRoomOpts)
246243
alice.JoinRoom(t, roomID, nil)
247244

248245
// Create the "live" event we are going to insert our backfilled events next to
@@ -289,10 +286,7 @@ func TestBackfillingHistory(t *testing.T) {
289286
t.Run("Unrecognised prev_event ID will throw an error", func(t *testing.T) {
290287
t.Parallel()
291288

292-
roomID := as.CreateRoom(t, map[string]interface{}{
293-
"preset": "public_chat",
294-
"name": "the hangout spot",
295-
})
289+
roomID := as.CreateRoom(t, createRoomOpts)
296290

297291
batchSendHistoricalMessages(
298292
t,
@@ -314,10 +308,7 @@ func TestBackfillingHistory(t *testing.T) {
314308
t.Run("Normal users aren't allowed to backfill messages", func(t *testing.T) {
315309
t.Parallel()
316310

317-
roomID := as.CreateRoom(t, map[string]interface{}{
318-
"preset": "public_chat",
319-
"name": "the hangout spot",
320-
})
311+
roomID := as.CreateRoom(t, createRoomOpts)
321312
alice.JoinRoom(t, roomID, nil)
322313

323314
eventIDsBefore := createMessagesInRoom(t, alice, roomID, 1)
@@ -348,10 +339,7 @@ func TestBackfillingHistory(t *testing.T) {
348339
t.Skip("Skipping until federation is implemented")
349340
t.Parallel()
350341

351-
roomID := as.CreateRoom(t, map[string]interface{}{
352-
"preset": "public_chat",
353-
"name": "the hangout spot",
354-
})
342+
roomID := as.CreateRoom(t, createRoomOpts)
355343
alice.JoinRoom(t, roomID, nil)
356344

357345
eventIDsBefore := createMessagesInRoom(t, alice, roomID, 1)
@@ -406,10 +394,7 @@ func TestBackfillingHistory(t *testing.T) {
406394
t.Skip("Skipping until federation is implemented")
407395
t.Parallel()
408396

409-
roomID := as.CreateRoom(t, map[string]interface{}{
410-
"preset": "public_chat",
411-
"name": "the hangout spot",
412-
})
397+
roomID := as.CreateRoom(t, createRoomOpts)
413398
alice.JoinRoom(t, roomID, nil)
414399

415400
eventIDsBefore := createMessagesInRoom(t, alice, roomID, 1)
@@ -482,10 +467,7 @@ func TestBackfillingHistory(t *testing.T) {
482467
t.Skip("Skipping until federation is implemented")
483468
t.Parallel()
484469

485-
roomID := as.CreateRoom(t, map[string]interface{}{
486-
"preset": "public_chat",
487-
"name": "the hangout spot",
488-
})
470+
roomID := as.CreateRoom(t, createRoomOpts)
489471
alice.JoinRoom(t, roomID, nil)
490472

491473
// Join the room from a remote homeserver before any backfilled messages are sent
@@ -589,10 +571,7 @@ func TestBackfillingHistory(t *testing.T) {
589571
t.Skip("Skipping until federation is implemented")
590572
t.Parallel()
591573

592-
roomID := as.CreateRoom(t, map[string]interface{}{
593-
"preset": "public_chat",
594-
"name": "the hangout spot",
595-
})
574+
roomID := as.CreateRoom(t, createRoomOpts)
596575
alice.JoinRoom(t, roomID, nil)
597576

598577
// Join the room from a remote homeserver before any backfilled messages are sent

0 commit comments

Comments
 (0)