mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-22 13:33:09 -06:00
More testing, make codecov happy?
This commit is contained in:
parent
d148589c07
commit
2d405ac4c3
|
|
@ -53,7 +53,7 @@ func TestJoinRoomByIDOrAlias(t *testing.T) {
|
||||||
bobDev := &uapi.Device{UserID: bob.ID}
|
bobDev := &uapi.Device{UserID: bob.ID}
|
||||||
charlieDev := &uapi.Device{UserID: charlie.ID, AccountType: uapi.AccountTypeGuest}
|
charlieDev := &uapi.Device{UserID: charlie.ID, AccountType: uapi.AccountTypeGuest}
|
||||||
|
|
||||||
// create the room
|
// create a room with disabled guest access and invite Bob
|
||||||
resp := createRoom(ctx, createRoomRequest{
|
resp := createRoom(ctx, createRoomRequest{
|
||||||
Name: "testing",
|
Name: "testing",
|
||||||
IsDirect: true,
|
IsDirect: true,
|
||||||
|
|
@ -69,6 +69,21 @@ func TestJoinRoomByIDOrAlias(t *testing.T) {
|
||||||
t.Fatalf("response is not a createRoomResponse: %+v", resp)
|
t.Fatalf("response is not a createRoomResponse: %+v", resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// create a room with guest access enabled and invite Charlie
|
||||||
|
resp = createRoom(ctx, createRoomRequest{
|
||||||
|
Name: "testing",
|
||||||
|
IsDirect: true,
|
||||||
|
Topic: "testing",
|
||||||
|
Visibility: "public",
|
||||||
|
Preset: presetPublicChat,
|
||||||
|
Invite: []string{charlie.ID},
|
||||||
|
GuestCanJoin: true,
|
||||||
|
}, aliceDev, &base.Cfg.ClientAPI, userAPI, rsAPI, asAPI, time.Now())
|
||||||
|
crRespWithGuestAccess, ok := resp.JSON.(createRoomResponse)
|
||||||
|
if !ok {
|
||||||
|
t.Fatalf("response is not a createRoomResponse: %+v", resp)
|
||||||
|
}
|
||||||
|
|
||||||
// Dummy request
|
// Dummy request
|
||||||
body := &bytes.Buffer{}
|
body := &bytes.Buffer{}
|
||||||
req, err := http.NewRequest(http.MethodPost, "/?server_name=test", body)
|
req, err := http.NewRequest(http.MethodPost, "/?server_name=test", body)
|
||||||
|
|
@ -124,6 +139,11 @@ func TestJoinRoomByIDOrAlias(t *testing.T) {
|
||||||
device: aliceDev,
|
device: aliceDev,
|
||||||
roomID: "#doesnotexist:test",
|
roomID: "#doesnotexist:test",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "room with guest_access event",
|
||||||
|
device: charlieDev,
|
||||||
|
roomID: crRespWithGuestAccess.RoomID,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue