Clean tests
This commit is contained in:
parent
86d848458e
commit
2fda1bb5d1
|
@ -85,7 +85,7 @@ describe("/api/global/scim/v2/users", () => {
|
|||
const getScimUsers = config.api.scimUsersAPI.get
|
||||
|
||||
it("unauthorised calls are not allowed", async () => {
|
||||
const response = await getScimUsers(undefined, {
|
||||
const response = await getScimUsers({
|
||||
setHeaders: false,
|
||||
expect: 403,
|
||||
})
|
||||
|
@ -95,7 +95,7 @@ describe("/api/global/scim/v2/users", () => {
|
|||
|
||||
it("cannot be called when feature is disabled", async () => {
|
||||
mocks.licenses.useCloudFree()
|
||||
const response = await getScimUsers(undefined, { expect: 400 })
|
||||
const response = await getScimUsers({ expect: 400 })
|
||||
|
||||
expect(response).toEqual(featureDisabledResponse)
|
||||
})
|
||||
|
@ -142,7 +142,7 @@ describe("/api/global/scim/v2/users", () => {
|
|||
})
|
||||
|
||||
it("fetches second page", async () => {
|
||||
const response = await getScimUsers({ startIndex: 20 })
|
||||
const response = await getScimUsers({ params: { startIndex: 20 } })
|
||||
|
||||
expect(response).toEqual({
|
||||
Resources: users.slice(20),
|
||||
|
|
|
@ -43,10 +43,12 @@ export class ScimUsersAPI extends TestAPI {
|
|||
}
|
||||
|
||||
get = async (
|
||||
params?: { startIndex?: number; pageSize?: number },
|
||||
requestSettings?: Partial<RequestSettings>
|
||||
requestSettings?: Partial<RequestSettings> & {
|
||||
params?: { startIndex?: number; pageSize?: number }
|
||||
}
|
||||
) => {
|
||||
let url = `/api/global/scim/v2/users?`
|
||||
const params = requestSettings?.params
|
||||
if (params?.pageSize) {
|
||||
url += `count=${params.pageSize}&`
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue