From 3dfe255eb499722420e021240abc703f191ea764 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 14 Apr 2021 17:27:58 +0100 Subject: [PATCH] Removing test case that isn't valid anymore. --- packages/server/src/api/controllers/user.js | 4 ---- packages/server/src/api/routes/tests/user.spec.js | 8 +------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/packages/server/src/api/controllers/user.js b/packages/server/src/api/controllers/user.js index 9bcd8315bb..28576194c0 100644 --- a/packages/server/src/api/controllers/user.js +++ b/packages/server/src/api/controllers/user.js @@ -45,10 +45,6 @@ exports.createMetadata = async function(ctx) { const { roleId } = ctx.request.body const email = ctx.request.body.email || ctx.user.email - if (!email) { - ctx.throw(400, "Require email to manage user") - } - // check role valid const role = await getRole(appId, roleId) if (!role) ctx.throw(400, "Invalid Role") diff --git a/packages/server/src/api/routes/tests/user.spec.js b/packages/server/src/api/routes/tests/user.spec.js index afdedef512..3c4d6a09e6 100644 --- a/packages/server/src/api/routes/tests/user.spec.js +++ b/packages/server/src/api/routes/tests/user.spec.js @@ -105,13 +105,7 @@ describe("/users", () => { failRole: BUILTIN_ROLE_IDS.PUBLIC, }) }) - - it("should error if no email provided", async () => { - const user = basicUser(BUILTIN_ROLE_IDS.POWER) - delete user.email - await create(user, 400) - }) - + it("should error if no role provided", async () => { const user = basicUser(null) await create(user, 400)