Skip to content

Commit 3eaa989

Browse files
authored
Always specify a preset (#166)
* Always specify a preset Synapse and Dendrite disagree what the join rules are if this is omitted. Dendrite follows the spec, Synapse doesn't. Nontheless, we should be specific in tests. * Don't use map[string]interface{} Whilst most of the time this is fine, it isn't in v1 paths which return `[$status_code, $json_object]`. Use `interface{}` instead. * Set public_chat on knocking msc
1 parent 08c1002 commit 3eaa989

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

tests/federation_room_join_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,9 @@ func TestCannotSendNonLeaveViaSendLeaveV2(t *testing.T) {
290290
// and checks that they are all rejected.
291291
func testValidationForSendMembershipEndpoint(t *testing.T, baseApiPath, expectedMembership string, createRoomOpts map[string]interface{}) {
292292
if createRoomOpts == nil {
293-
createRoomOpts = make(map[string]interface{})
293+
createRoomOpts = map[string]interface{}{
294+
"preset": "public_chat",
295+
}
294296
}
295297

296298
deployment := Deploy(t, b.BlueprintAlice)
@@ -324,7 +326,7 @@ func testValidationForSendMembershipEndpoint(t *testing.T, baseApiPath, expected
324326
return
325327
}
326328

327-
var res map[string]interface{}
329+
var res interface{}
328330
err := srv.SendFederationRequest(deployment, req, &res)
329331
if err == nil {
330332
t.Errorf("send request returned 200")

tests/msc2403_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,7 @@ func publishAndCheckRoomJoinRule(t *testing.T, c *client.CSAPI, roomID, expected
473473
func TestCannotSendNonKnockViaSendKnock(t *testing.T) {
474474
testValidationForSendMembershipEndpoint(t, "/_matrix/federation/v1/send_knock", "knock",
475475
map[string]interface{}{
476+
"preset": "public_chat",
476477
"room_version": "7",
477478
},
478479
)

0 commit comments

Comments
 (0)