From 1c39ad873c276e992881e800ca81ef011eecd4eb Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 12 Jun 2023 11:06:45 +0200 Subject: [PATCH] resolve dev conflicts --- back/models/vn-user.js | 1 - .../account/back/methods/account/specs/set-password.spec.js | 5 ++--- modules/client/back/methods/client/specs/setPassword.spec.js | 5 ++--- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/back/models/vn-user.js b/back/models/vn-user.js index bf568e85c7..fb32793539 100644 --- a/back/models/vn-user.js +++ b/back/models/vn-user.js @@ -110,7 +110,6 @@ module.exports = function(Self) { const _setPassword = Self.prototype.setPassword; Self.prototype.setPassword = async function(newPassword, options, cb) { - console.log('ENTRY'); if (cb === undefined && typeof options === 'function') { cb = options; options = undefined; diff --git a/modules/account/back/methods/account/specs/set-password.spec.js b/modules/account/back/methods/account/specs/set-password.spec.js index f54fba36fe..5de2a7bad1 100644 --- a/modules/account/back/methods/account/specs/set-password.spec.js +++ b/modules/account/back/methods/account/specs/set-password.spec.js @@ -1,15 +1,14 @@ const {models} = require('vn-loopback/server/server'); describe('Account setPassword()', () => { - const ctx = {req: {accessToken: {userId: 9}}}; it('should throw an error when password does not meet requirements', async() => { - let req = models.Account.setPassword(ctx, 1, 'insecurePass'); + let req = models.Account.setPassword(1, 'insecurePass'); await expectAsync(req).toBeRejected(); }); it('should update password when it passes requirements', async() => { - let req = models.Account.setPassword(ctx, 1, 'Very$ecurePa22.'); + let req = models.Account.setPassword(1, 'Very$ecurePa22.'); await expectAsync(req).toBeResolved(); }); diff --git a/modules/client/back/methods/client/specs/setPassword.spec.js b/modules/client/back/methods/client/specs/setPassword.spec.js index c004b0372a..590172a02b 100644 --- a/modules/client/back/methods/client/specs/setPassword.spec.js +++ b/modules/client/back/methods/client/specs/setPassword.spec.js @@ -1,12 +1,11 @@ const models = require('vn-loopback/server/server').models; describe('Client setPassword', () => { - const ctx = {req: {accessToken: {userId: 9}}}; it('should throw an error the setPassword target is not just a client but a worker', async() => { let error; try { - await models.Client.setPassword(ctx, 1, 't0pl3v3l.p455w0rd!'); + await models.Client.setPassword(1, 't0pl3v3l.p455w0rd!'); } catch (e) { error = e; } @@ -18,7 +17,7 @@ describe('Client setPassword', () => { let error; try { - await models.Client.setPassword(ctx, 1101, 't0pl3v3l.p455w0rd!'); + await models.Client.setPassword(1101, 't0pl3v3l.p455w0rd!'); } catch (e) { error = e; }