feat: Rebuilt member admin (#2139)

This commit is contained in:
Tom Moor
2021-05-19 21:36:10 -07:00
committed by GitHub
parent 833bd51f4c
commit b0196f0cf0
23 changed files with 770 additions and 291 deletions

View File

@ -35,7 +35,7 @@ describe("#users.list", () => {
expect(body.data[0].id).toEqual(user.id);
});
it("should allow including suspended", async () => {
it("should allow filtering to suspended users", async () => {
const user = await buildUser({ name: "Tester" });
await buildUser({
name: "Tester",
@ -46,14 +46,35 @@ describe("#users.list", () => {
const res = await server.post("/api/users.list", {
body: {
query: "test",
includeSuspended: true,
filter: "suspended",
token: user.getJwtToken(),
},
});
const body = await res.json();
expect(res.status).toEqual(200);
expect(body.data.length).toEqual(2);
expect(body.data.length).toEqual(1);
});
it("should allow filtering to invited", async () => {
const user = await buildUser({ name: "Tester" });
await buildUser({
name: "Tester",
teamId: user.teamId,
lastActiveAt: null,
});
const res = await server.post("/api/users.list", {
body: {
query: "test",
filter: "invited",
token: user.getJwtToken(),
},
});
const body = await res.json();
expect(res.status).toEqual(200);
expect(body.data.length).toEqual(1);
});
it("should return teams paginated user list", async () => {