mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-13 21:02:25 +03:00
Add check to confirm that state preset is effectively private when present and visibility are unset
This commit is contained in:
parent
f9745381e5
commit
2849080417
1 changed files with 16 additions and 1 deletions
|
@ -2330,8 +2330,23 @@ func TestCreateRoomInvite(t *testing.T) {
|
||||||
|
|
||||||
roomID := gjson.GetBytes(w.Body.Bytes(), "room_id").Str
|
roomID := gjson.GetBytes(w.Body.Bytes(), "room_id").Str
|
||||||
validRoomID, _ := spec.NewRoomID(roomID)
|
validRoomID, _ := spec.NewRoomID(roomID)
|
||||||
|
|
||||||
|
// Confirm that the room matches the private state preset
|
||||||
|
ev, err := rsAPI.CurrentStateEvent(context.Background(), *validRoomID, spec.MRoomJoinRules, spec.Invite)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
ev, err = rsAPI.CurrentStateEvent(context.Background(), *validRoomID, spec.MRoomHistoryVisibility, string(gomatrixserverlib.HistoryVisibilityShared))
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
ev, err = rsAPI.CurrentStateEvent(context.Background(), *validRoomID, spec.MRoomGuestAccess, "can_join")
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
// Now ask the roomserver about the membership event of Bob
|
// Now ask the roomserver about the membership event of Bob
|
||||||
ev, err := rsAPI.CurrentStateEvent(context.Background(), *validRoomID, spec.MRoomMember, bob.ID)
|
ev, err = rsAPI.CurrentStateEvent(context.Background(), *validRoomID, spec.MRoomMember, bob.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue