From 2123c06df5db12178f7a6435a9f343fc45298c31 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 7 Dec 2020 21:11:07 +0000 Subject: [PATCH] fix tests --- packages/server/src/api/controllers/user.js | 1 - packages/server/src/api/routes/tests/user.spec.js | 7 +++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/server/src/api/controllers/user.js b/packages/server/src/api/controllers/user.js index 5cdfb68d8f..1afd120e4a 100644 --- a/packages/server/src/api/controllers/user.js +++ b/packages/server/src/api/controllers/user.js @@ -48,7 +48,6 @@ exports.create = async function(ctx) { ctx.body = { _rev: response.rev, email, - name, } } catch (err) { if (err.status === 409) { diff --git a/packages/server/src/api/routes/tests/user.spec.js b/packages/server/src/api/routes/tests/user.spec.js index 94dcb6c63c..e6f6795e52 100644 --- a/packages/server/src/api/routes/tests/user.spec.js +++ b/packages/server/src/api/routes/tests/user.spec.js @@ -48,7 +48,7 @@ describe("/users", () => { }) it("should apply authorization to endpoint", async () => { - await createUser(request, appId, "brenda", "brendas_password") + await createUser(request, appId, "brenda@brenda.com", "brendas_password") await testPermissionsForEndpoint({ request, method: "GET", @@ -62,12 +62,11 @@ describe("/users", () => { }) describe("create", () => { - it("returns a success message when a user is successfully created", async () => { const res = await request .post(`/api/users`) .set(defaultHeaders(appId)) - .send({ name: "Bill", email: "bill@bill.com", password: "bills_password", accessLevelId: BUILTIN_LEVEL_IDS.POWER }) + .send({ email: "bill@bill.com", password: "bills_password", accessLevelId: BUILTIN_LEVEL_IDS.POWER }) .expect(200) .expect('Content-Type', /json/) @@ -79,7 +78,7 @@ describe("/users", () => { await testPermissionsForEndpoint({ request, method: "POST", - body: { name: "brandNewUser", email: "brandNewUser@user.com", password: "yeeooo", accessLevelId: BUILTIN_LEVEL_IDS.POWER }, + body: { email: "brandNewUser@user.com", password: "yeeooo", accessLevelId: BUILTIN_LEVEL_IDS.POWER }, url: `/api/users`, appId: appId, permName1: BUILTIN_PERMISSION_NAMES.ADMIN,