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.withUser(builder, async () => {
|
||||||
await config.api.groups.updateGroupUsers(group._id!, {
|
await config.api.groups.updateGroupUsers(
|
||||||
|
group._id!,
|
||||||
|
{
|
||||||
add: [builder._id!],
|
add: [builder._id!],
|
||||||
remove: [],
|
remove: [],
|
||||||
})
|
},
|
||||||
|
{ expect: 403 }
|
||||||
|
)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -47,14 +47,15 @@ export class GroupsAPI extends TestAPI {
|
||||||
|
|
||||||
updateGroupUsers = (
|
updateGroupUsers = (
|
||||||
id: string,
|
id: string,
|
||||||
body: { add: string[]; remove: string[] }
|
body: { add: string[]; remove: string[] },
|
||||||
|
{ expect } = { expect: 200 }
|
||||||
) => {
|
) => {
|
||||||
return this.request
|
return this.request
|
||||||
.post(`/api/global/groups/${id}/users`)
|
.post(`/api/global/groups/${id}/users`)
|
||||||
.send(body)
|
.send(body)
|
||||||
.set(this.config.defaultHeaders())
|
.set(this.config.defaultHeaders())
|
||||||
.expect("Content-Type", /json/)
|
.expect("Content-Type", /json/)
|
||||||
.expect(200)
|
.expect(expect)
|
||||||
}
|
}
|
||||||
|
|
||||||
fetch = ({ expect } = { expect: 200 }) => {
|
fetch = ({ expect } = { expect: 200 }) => {
|
||||||
|
|
Loading…
Reference in New Issue