Fix tests
This commit is contained in:
parent
cd0004ec3d
commit
26c98ea084
|
@ -319,12 +319,16 @@ describe("/api/global/groups", () => {
|
|||
})
|
||||
})
|
||||
|
||||
it("update should return 200", async () => {
|
||||
it("update should return forbidden", async () => {
|
||||
await config.withUser(builder, async () => {
|
||||
await config.api.groups.updateGroupUsers(group._id!, {
|
||||
await config.api.groups.updateGroupUsers(
|
||||
group._id!,
|
||||
{
|
||||
add: [builder._id!],
|
||||
remove: [],
|
||||
})
|
||||
},
|
||||
{ expect: 403 }
|
||||
)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
@ -47,14 +47,15 @@ export class GroupsAPI extends TestAPI {
|
|||
|
||||
updateGroupUsers = (
|
||||
id: string,
|
||||
body: { add: string[]; remove: string[] }
|
||||
body: { add: string[]; remove: string[] },
|
||||
{ expect } = { expect: 200 }
|
||||
) => {
|
||||
return this.request
|
||||
.post(`/api/global/groups/${id}/users`)
|
||||
.send(body)
|
||||
.set(this.config.defaultHeaders())
|
||||
.expect("Content-Type", /json/)
|
||||
.expect(200)
|
||||
.expect(expect)
|
||||
}
|
||||
|
||||
fetch = ({ expect } = { expect: 200 }) => {
|
||||
|
|
Loading…
Reference in New Issue