Skip to content

Commit

Permalink
Adapt MSC2716 implementation to org.matrix.msc2716 experimental roo…
Browse files Browse the repository at this point in the history
…m 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
  • Loading branch information
MadLittleMods committed Jul 26, 2021
1 parent e9e86d3 commit fd752eb
Showing 1 changed file with 15 additions and 36 deletions.
51 changes: 15 additions & 36 deletions tests/msc2716_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit fd752eb

Please sign in to comment.