Skip to content

Commit fe23ef4

Browse files
committed
Lowercase as they aren't being shared outside of this file so they don't need to be public
1 parent 35527a4 commit fe23ef4

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Diff for: tests/knocking_test.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,11 @@ func knockingBetweenTwoUsersTest(t *testing.T, roomID string, inRoomUser, knocki
117117
})
118118

119119
t.Run("Knocking on a room with join rule 'knock' should succeed", func(t *testing.T) {
120-
MustKnockOnRoomSynced(t, knockingUser, roomID, testKnockReason, []string{"hs1"})
120+
mustKnockOnRoomSynced(t, knockingUser, roomID, testKnockReason, []string{"hs1"})
121121
})
122122

123123
t.Run("A user that has already knocked is allowed to knock again on the same room", func(t *testing.T) {
124-
MustKnockOnRoomSynced(t, knockingUser, roomID, "I really like knock knock jokes", []string{"hs1"})
124+
mustKnockOnRoomSynced(t, knockingUser, roomID, "I really like knock knock jokes", []string{"hs1"})
125125
})
126126

127127
t.Run("Users in the room see a user's membership update when they knock", func(t *testing.T) {
@@ -183,7 +183,7 @@ func knockingBetweenTwoUsersTest(t *testing.T, roomID string, inRoomUser, knocki
183183
})
184184

185185
// Knock again to return us to the knocked state
186-
MustKnockOnRoomSynced(t, knockingUser, roomID, "Let me in... again?", []string{"hs1"})
186+
mustKnockOnRoomSynced(t, knockingUser, roomID, "Let me in... again?", []string{"hs1"})
187187
})
188188
}
189189

@@ -211,7 +211,7 @@ func knockingBetweenTwoUsersTest(t *testing.T, roomID string, inRoomUser, knocki
211211
}))
212212

213213
// Knock again
214-
MustKnockOnRoomSynced(t, knockingUser, roomID, "Pleeease let me in?", []string{"hs1"})
214+
mustKnockOnRoomSynced(t, knockingUser, roomID, "Pleeease let me in?", []string{"hs1"})
215215
})
216216

217217
t.Run("A user can knock on a room without a reason", func(t *testing.T) {
@@ -227,7 +227,7 @@ func knockingBetweenTwoUsersTest(t *testing.T, roomID string, inRoomUser, knocki
227227
)
228228

229229
// Knock again, this time without a reason
230-
MustKnockOnRoomSynced(t, knockingUser, roomID, "", []string{"hs1"})
230+
mustKnockOnRoomSynced(t, knockingUser, roomID, "", []string{"hs1"})
231231
})
232232

233233
t.Run("A user in the room can accept a knock", func(t *testing.T) {
@@ -279,7 +279,7 @@ func knockingBetweenTwoUsersTest(t *testing.T, roomID string, inRoomUser, knocki
279279
})
280280
}
281281

282-
func SyncKnockedOn(userID, roomID string) client.SyncCheckOpt {
282+
func syncKnockedOn(userID, roomID string) client.SyncCheckOpt {
283283
return func(clientUserID string, topLevelSyncJSON gjson.Result) error {
284284
// two forms which depend on what the client user is:
285285
// - passively viewing a membership for a room you're joined in
@@ -301,14 +301,14 @@ func SyncKnockedOn(userID, roomID string) client.SyncCheckOpt {
301301
}
302302
}
303303

304-
// MustKnockOnRoomSynced will knock on a given room on the behalf of a user, and block until the knock has persisted.
304+
// mustKnockOnRoomSynced will knock on a given room on the behalf of a user, and block until the knock has persisted.
305305
// serverNames should be populated if knocking on a room that the user's homeserver isn't currently a part of.
306306
// Fails the test if the knock response does not return a 200 status code.
307-
func MustKnockOnRoomSynced(t *testing.T, c *client.CSAPI, roomID, reason string, serverNames []string) {
307+
func mustKnockOnRoomSynced(t *testing.T, c *client.CSAPI, roomID, reason string, serverNames []string) {
308308
knockOnRoomWithStatus(t, c, roomID, reason, serverNames, 200)
309309

310310
// The knock should have succeeded. Block until we see the knock appear down sync
311-
c.MustSyncUntil(t, client.SyncReq{}, SyncKnockedOn(c.UserID, roomID))
311+
c.MustSyncUntil(t, client.SyncReq{}, syncKnockedOn(c.UserID, roomID))
312312
}
313313

314314
// knockOnRoomWithStatus will knock on a given room on the behalf of a user.

0 commit comments

Comments
 (0)