Add test
This commit is contained in:
parent
5e7a8f18e5
commit
63244e1dde
|
@ -1 +1 @@
|
||||||
Subproject commit a0a7b5e1566467cc0625fb69309364c750847962
|
Subproject commit ae1dd6f353cb8a124e3738fb1a58214db6b2df08
|
|
@ -1,5 +1,8 @@
|
||||||
import { events } from "@budibase/backend-core"
|
import { events } from "@budibase/backend-core"
|
||||||
import { structures, TestConfiguration, mocks } from "../../../../tests"
|
import { structures, TestConfiguration, mocks } from "../../../../tests"
|
||||||
|
import { UserGroup } from "@budibase/types"
|
||||||
|
|
||||||
|
mocks.licenses.useGroups()
|
||||||
|
|
||||||
describe("/api/global/groups", () => {
|
describe("/api/global/groups", () => {
|
||||||
const config = new TestConfiguration()
|
const config = new TestConfiguration()
|
||||||
|
@ -113,4 +116,23 @@ describe("/api/global/groups", () => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe("find users", () => {
|
||||||
|
describe("without users", () => {
|
||||||
|
let group: UserGroup
|
||||||
|
beforeAll(async () => {
|
||||||
|
group = structures.groups.UserGroup()
|
||||||
|
await config.api.groups.saveGroup(group)
|
||||||
|
})
|
||||||
|
|
||||||
|
it("should return empty", async () => {
|
||||||
|
const result = await config.api.groups.searchUsers(group._id!)
|
||||||
|
expect(result.body).toEqual({
|
||||||
|
users: [],
|
||||||
|
bookmark: undefined,
|
||||||
|
hasNextPage: false,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -23,4 +23,12 @@ export class GroupsAPI extends TestAPI {
|
||||||
.expect("Content-Type", /json/)
|
.expect("Content-Type", /json/)
|
||||||
.expect(200)
|
.expect(200)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
searchUsers = (id: string) => {
|
||||||
|
return this.request
|
||||||
|
.get(`/api/global/groups/${id}/users`)
|
||||||
|
.set(this.config.defaultHeaders())
|
||||||
|
.expect("Content-Type", /json/)
|
||||||
|
.expect(200)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue