Skip to content

Commit

Permalink
add complement test for getting joined_members after leaving. (#424)
Browse files Browse the repository at this point in the history
Co-authored-by: David Robertson <david.m.robertson1@gmail.com>
Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
  • Loading branch information
3 people authored Aug 17, 2022
1 parent 1c5910c commit 9b3628f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/csapi/apidoc_room_state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/matrix-org/complement/internal/client"
"github.com/matrix-org/complement/internal/match"
"github.com/matrix-org/complement/internal/must"
"github.com/matrix-org/complement/runtime"

"net/http"
)
Expand Down Expand Up @@ -328,5 +329,18 @@ func TestRoomState(t *testing.T) {
},
})
})
t.Run("GET /rooms/:room_id/joined_members is forbidden after leaving room", func(t *testing.T) {
runtime.SkipIf(t, runtime.Dendrite) // https://github.com/matrix-org/complement/pull/424
t.Parallel()
roomID := authedClient.CreateRoom(t, map[string]interface{}{})
authedClient.LeaveRoom(t, roomID)
res := authedClient.DoFunc(t, "GET", []string{"_matrix", "client", "r0", "rooms", roomID, "joined_members"})
must.MatchResponse(t, res, match.HTTPResponse{
StatusCode: http.StatusForbidden,
JSON: []match.JSON{
match.JSONKeyEqual("errcode", "M_FORBIDDEN"),
},
})
})
})
}

0 comments on commit 9b3628f

Please sign in to comment.