45
45
markerInsertionContentField = "org.matrix.msc2716.marker.insertion"
46
46
)
47
47
48
+ var createRoomOpts = map [string ]interface {}{
49
+ "preset" : "public_chat" ,
50
+ "name" : "the hangout spot" ,
51
+ "room_version" : "org.matrix.msc2716" ,
52
+ }
53
+
48
54
func TestBackfillingHistory (t * testing.T ) {
49
55
deployment := Deploy (t , b .BlueprintHSWithApplicationService )
50
56
defer deployment .Destroy (t )
@@ -75,10 +81,7 @@ func TestBackfillingHistory(t *testing.T) {
75
81
t .Run ("Backfilled historical events resolve with proper state in correct order" , func (t * testing.T ) {
76
82
t .Parallel ()
77
83
78
- roomID := as .CreateRoom (t , map [string ]interface {}{
79
- "preset" : "public_chat" ,
80
- "name" : "the hangout spot" ,
81
- })
84
+ roomID := as .CreateRoom (t , createRoomOpts )
82
85
alice .JoinRoom (t , roomID , nil )
83
86
84
87
// Create some normal messages in the timeline. We're creating them in
@@ -189,10 +192,7 @@ func TestBackfillingHistory(t *testing.T) {
189
192
t .Run ("Backfilled historical events from multiple users in the same chunk" , func (t * testing.T ) {
190
193
t .Parallel ()
191
194
192
- roomID := as .CreateRoom (t , map [string ]interface {}{
193
- "preset" : "public_chat" ,
194
- "name" : "the hangout spot" ,
195
- })
195
+ roomID := as .CreateRoom (t , createRoomOpts )
196
196
alice .JoinRoom (t , roomID , nil )
197
197
198
198
// Create the "live" event we are going to insert our backfilled events next to
@@ -239,10 +239,7 @@ func TestBackfillingHistory(t *testing.T) {
239
239
t .Run ("Backfilled historical events with m.historical do not come down in an incremental sync" , func (t * testing.T ) {
240
240
t .Parallel ()
241
241
242
- roomID := as .CreateRoom (t , map [string ]interface {}{
243
- "preset" : "public_chat" ,
244
- "name" : "the hangout spot" ,
245
- })
242
+ roomID := as .CreateRoom (t , createRoomOpts )
246
243
alice .JoinRoom (t , roomID , nil )
247
244
248
245
// Create the "live" event we are going to insert our backfilled events next to
@@ -289,10 +286,7 @@ func TestBackfillingHistory(t *testing.T) {
289
286
t .Run ("Unrecognised prev_event ID will throw an error" , func (t * testing.T ) {
290
287
t .Parallel ()
291
288
292
- roomID := as .CreateRoom (t , map [string ]interface {}{
293
- "preset" : "public_chat" ,
294
- "name" : "the hangout spot" ,
295
- })
289
+ roomID := as .CreateRoom (t , createRoomOpts )
296
290
297
291
batchSendHistoricalMessages (
298
292
t ,
@@ -314,10 +308,7 @@ func TestBackfillingHistory(t *testing.T) {
314
308
t .Run ("Normal users aren't allowed to backfill messages" , func (t * testing.T ) {
315
309
t .Parallel ()
316
310
317
- roomID := as .CreateRoom (t , map [string ]interface {}{
318
- "preset" : "public_chat" ,
319
- "name" : "the hangout spot" ,
320
- })
311
+ roomID := as .CreateRoom (t , createRoomOpts )
321
312
alice .JoinRoom (t , roomID , nil )
322
313
323
314
eventIDsBefore := createMessagesInRoom (t , alice , roomID , 1 )
@@ -348,10 +339,7 @@ func TestBackfillingHistory(t *testing.T) {
348
339
t .Skip ("Skipping until federation is implemented" )
349
340
t .Parallel ()
350
341
351
- roomID := as .CreateRoom (t , map [string ]interface {}{
352
- "preset" : "public_chat" ,
353
- "name" : "the hangout spot" ,
354
- })
342
+ roomID := as .CreateRoom (t , createRoomOpts )
355
343
alice .JoinRoom (t , roomID , nil )
356
344
357
345
eventIDsBefore := createMessagesInRoom (t , alice , roomID , 1 )
@@ -406,10 +394,7 @@ func TestBackfillingHistory(t *testing.T) {
406
394
t .Skip ("Skipping until federation is implemented" )
407
395
t .Parallel ()
408
396
409
- roomID := as .CreateRoom (t , map [string ]interface {}{
410
- "preset" : "public_chat" ,
411
- "name" : "the hangout spot" ,
412
- })
397
+ roomID := as .CreateRoom (t , createRoomOpts )
413
398
alice .JoinRoom (t , roomID , nil )
414
399
415
400
eventIDsBefore := createMessagesInRoom (t , alice , roomID , 1 )
@@ -482,10 +467,7 @@ func TestBackfillingHistory(t *testing.T) {
482
467
t .Skip ("Skipping until federation is implemented" )
483
468
t .Parallel ()
484
469
485
- roomID := as .CreateRoom (t , map [string ]interface {}{
486
- "preset" : "public_chat" ,
487
- "name" : "the hangout spot" ,
488
- })
470
+ roomID := as .CreateRoom (t , createRoomOpts )
489
471
alice .JoinRoom (t , roomID , nil )
490
472
491
473
// Join the room from a remote homeserver before any backfilled messages are sent
@@ -589,10 +571,7 @@ func TestBackfillingHistory(t *testing.T) {
589
571
t .Skip ("Skipping until federation is implemented" )
590
572
t .Parallel ()
591
573
592
- roomID := as .CreateRoom (t , map [string ]interface {}{
593
- "preset" : "public_chat" ,
594
- "name" : "the hangout spot" ,
595
- })
574
+ roomID := as .CreateRoom (t , createRoomOpts )
596
575
alice .JoinRoom (t , roomID , nil )
597
576
598
577
// Join the room from a remote homeserver before any backfilled messages are sent
0 commit comments