Skip to content

Commit 29ddb41

Browse files
authored
Stabilize knock restricted tests (room v10). (#643)
Use room version 10 instead of the unstable room version (and remove references to the MSC since it is now part of the spec).
1 parent 39436e9 commit 29ddb41

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

tests/msc3787_test.go renamed to tests/knock_restricted_test.go

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
// +build msc3787
33

44
// This file contains tests for a join rule which mixes concepts of restricted joins
5-
// and knocking. This is currently experimental and defined by MSC3787, found here:
6-
// https://github.com/matrix-org/matrix-spec-proposals/pull/3787
5+
// and knocking. This is implemented in room version 10.
76
//
87
// Generally, this is a combination of knocking_test and restricted_rooms_test.
98

@@ -16,26 +15,26 @@ import (
1615
)
1716

1817
var (
19-
msc3787RoomVersion = "org.matrix.msc3787"
20-
msc3787JoinRule = "knock_restricted"
18+
roomVersion = "10"
19+
joinRule = "knock_restricted"
2120
)
2221

2322
// See TestKnocking
2423
func TestKnockingInMSC3787Room(t *testing.T) {
25-
doTestKnocking(t, msc3787RoomVersion, msc3787JoinRule)
24+
doTestKnocking(t, roomVersion, joinRule)
2625
}
2726

2827
// See TestKnockRoomsInPublicRoomsDirectory
2928
func TestKnockRoomsInPublicRoomsDirectoryInMSC3787Room(t *testing.T) {
30-
doTestKnockRoomsInPublicRoomsDirectory(t, msc3787RoomVersion, msc3787JoinRule)
29+
doTestKnockRoomsInPublicRoomsDirectory(t, roomVersion, joinRule)
3130
}
3231

3332
// See TestCannotSendKnockViaSendKnock
3433
func TestCannotSendKnockViaSendKnockInMSC3787Room(t *testing.T) {
3534
testValidationForSendMembershipEndpoint(t, "/_matrix/federation/v1/send_knock", "knock",
3635
map[string]interface{}{
3736
"preset": "public_chat",
38-
"room_version": msc3787RoomVersion,
37+
"room_version": roomVersion,
3938
},
4039
)
4140
}
@@ -46,13 +45,13 @@ func TestRestrictedRoomsLocalJoinInMSC3787Room(t *testing.T) {
4645
defer deployment.Destroy(t)
4746

4847
// Setup the user, allowed room, and restricted room.
49-
alice, allowed_room, room := setupRestrictedRoom(t, deployment, msc3787RoomVersion, msc3787JoinRule)
48+
alice, allowed_room, room := setupRestrictedRoom(t, deployment, roomVersion, joinRule)
5049

5150
// Create a second user on the same homeserver.
5251
bob := deployment.Client(t, "hs1", "@bob:hs1")
5352

5453
// Execute the checks.
55-
checkRestrictedRoom(t, alice, bob, allowed_room, room, msc3787JoinRule)
54+
checkRestrictedRoom(t, alice, bob, allowed_room, room, joinRule)
5655
}
5756

5857
// See TestRestrictedRoomsRemoteJoin
@@ -61,21 +60,21 @@ func TestRestrictedRoomsRemoteJoinInMSC3787Room(t *testing.T) {
6160
defer deployment.Destroy(t)
6261

6362
// Setup the user, allowed room, and restricted room.
64-
alice, allowed_room, room := setupRestrictedRoom(t, deployment, msc3787RoomVersion, msc3787JoinRule)
63+
alice, allowed_room, room := setupRestrictedRoom(t, deployment, roomVersion, joinRule)
6564

6665
// Create a second user on a different homeserver.
6766
bob := deployment.Client(t, "hs2", "@bob:hs2")
6867

6968
// Execute the checks.
70-
checkRestrictedRoom(t, alice, bob, allowed_room, room, msc3787JoinRule)
69+
checkRestrictedRoom(t, alice, bob, allowed_room, room, joinRule)
7170
}
7271

7372
// See TestRestrictedRoomsRemoteJoinLocalUser
7473
func TestRestrictedRoomsRemoteJoinLocalUserInMSC3787Room(t *testing.T) {
75-
doTestRestrictedRoomsRemoteJoinLocalUser(t, msc3787RoomVersion, msc3787JoinRule)
74+
doTestRestrictedRoomsRemoteJoinLocalUser(t, roomVersion, joinRule)
7675
}
7776

7877
// See TestRestrictedRoomsRemoteJoinFailOver
7978
func TestRestrictedRoomsRemoteJoinFailOverInMSC3787Room(t *testing.T) {
80-
doTestRestrictedRoomsRemoteJoinFailOver(t, msc3787RoomVersion, msc3787JoinRule)
79+
doTestRestrictedRoomsRemoteJoinFailOver(t, roomVersion, joinRule)
8180
}

0 commit comments

Comments
 (0)