|
| 1 | +package csapi_tests |
| 2 | + |
| 3 | +import ( |
| 4 | + "testing" |
| 5 | + |
| 6 | + "github.com/matrix-org/complement" |
| 7 | + "github.com/matrix-org/complement/client" |
| 8 | + "github.com/matrix-org/complement/helpers" |
| 9 | +) |
| 10 | + |
| 11 | +func TestSynapseConsistency(t *testing.T) { |
| 12 | + numHomeservers := 2 |
| 13 | + deployment := complement.Deploy(t, numHomeservers) |
| 14 | + defer deployment.Destroy(t) |
| 15 | + |
| 16 | + alice := deployment.Register(t, "hs1", helpers.RegistrationOpts{LocalpartSuffix: "alice"}) |
| 17 | + |
| 18 | + charlie1 := deployment.Register(t, "hs2", helpers.RegistrationOpts{LocalpartSuffix: "charlie1"}) |
| 19 | + charlie2 := deployment.Register(t, "hs2", helpers.RegistrationOpts{LocalpartSuffix: "charlie2"}) |
| 20 | + |
| 21 | + t.Run("test1", func(t *testing.T) { |
| 22 | + // Create a room between multiple providers (non-insurance user) and some normal insured users |
| 23 | + roomID := alice.MustCreateRoom(t, map[string]interface{}{ |
| 24 | + "preset": "private_chat", |
| 25 | + }) |
| 26 | + // Add multiple normal insured users |
| 27 | + alice.MustInviteRoom(t, roomID, charlie1.UserID) |
| 28 | + charlie1.MustSyncUntil(t, client.SyncReq{}, client.SyncInvitedTo(charlie1.UserID, roomID)) |
| 29 | + charlie1.MustJoinRoom(t, roomID, []string{"hs1"}) |
| 30 | + alice.MustInviteRoom(t, roomID, charlie2.UserID) |
| 31 | + charlie2.MustSyncUntil(t, client.SyncReq{}, client.SyncInvitedTo(charlie2.UserID, roomID)) |
| 32 | + charlie2.MustJoinRoom(t, roomID, []string{"hs1"}) |
| 33 | + }) |
| 34 | +} |
0 commit comments