From 8e46e2c0886c070a4456a2f81554664485becc4f Mon Sep 17 00:00:00 2001
From: Anca Ursachi <anca.ursachi@thinslices.com>
Date: Tue, 4 Dec 2018 09:54:55 +0200
Subject: [PATCH] test(changePassword.test): Repair some tests after some minor
 changes in the file changePassword.

---
 .../src/tests/users/changePassword.test.js             | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/packages/component-user-manager/src/tests/users/changePassword.test.js b/packages/component-user-manager/src/tests/users/changePassword.test.js
index 6ef513d8f..c4118fb54 100644
--- a/packages/component-user-manager/src/tests/users/changePassword.test.js
+++ b/packages/component-user-manager/src/tests/users/changePassword.test.js
@@ -13,8 +13,8 @@ jest.mock('@pubsweet/component-send-email', () => ({
 }))
 
 const reqBody = {
-  password: 'password',
-  newPassword: 'N3wPassword!',
+  currentPassword: 'password',
+  password: 'N3wPassword!',
 }
 
 const notFoundError = new Error()
@@ -44,7 +44,7 @@ describe('Users password reset route handler', () => {
     expect(data.error).toEqual('Missing required params.')
   })
   it('should return an error when the password is too small', async () => {
-    body.newPassword = 'small'
+    body.password = 'small'
     const req = httpMocks.createRequest({ body })
     req.user = user.id
 
@@ -67,7 +67,7 @@ describe('Users password reset route handler', () => {
     expect(data.error).toEqual('User not found')
   })
   it('should return an error when the current password is incorrect', async () => {
-    body.password = 'invalid-password'
+    body.currentPassword = 'invalid-password'
     const req = httpMocks.createRequest({ body })
     req.user = user.id
 
@@ -90,6 +90,6 @@ describe('Users password reset route handler', () => {
     savedUser.validPassword = user.validPassword
     expect(savedUser.token).not.toEqual(user.token)
 
-    expect(savedUser.validPassword(body.newPassword)).toBeTruthy()
+    expect(savedUser.validPassword(body.password)).toBeTruthy()
   })
 })
-- 
GitLab