filter by email
This commit is contained in:
parent
05b7467076
commit
3b07f0e1a2
|
@ -57,7 +57,6 @@ export interface User extends Document {
|
|||
userName: string
|
||||
externalId: string
|
||||
isSync: boolean
|
||||
firstSync: number
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -191,6 +191,26 @@ describe("/api/global/scim/v2/users", () => {
|
|||
totalResults: 1,
|
||||
})
|
||||
})
|
||||
|
||||
it("can filter by email", async () => {
|
||||
const userToFetch = _.sample(users)
|
||||
|
||||
const response = await getScimUsers({
|
||||
params: {
|
||||
filter: encodeURI(
|
||||
`emails[type eq "work"].value eq "${userToFetch?.emails[0].value}"`
|
||||
),
|
||||
},
|
||||
})
|
||||
|
||||
expect(response).toEqual({
|
||||
Resources: [userToFetch],
|
||||
itemsPerPage: 20,
|
||||
schemas: ["urn:ietf:params:scim:api:messages:2.0:ListResponse"],
|
||||
startIndex: 1,
|
||||
totalResults: 1,
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue