1
0
Fork 0
mirror of synced 2024-07-07 15:25:52 +12:00

filter by email

This commit is contained in:
adrinr 2023-03-15 21:53:20 +01:00
parent 05b7467076
commit 3b07f0e1a2
2 changed files with 20 additions and 1 deletions

View file

@ -57,7 +57,6 @@ export interface User extends Document {
userName: string
externalId: string
isSync: boolean
firstSync: number
}
}

View file

@ -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,
})
})
})
})