Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
X
xpub-faraday
Manage
Activity
Members
Labels
Plan
Issues
2
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container Registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
xpub
xpub-faraday
Commits
8e46e2c0
Commit
8e46e2c0
authored
6 years ago
by
Anca Ursachi
Browse files
Options
Downloads
Patches
Plain Diff
test(changePassword.test): Repair some tests after some minor changes in the file changePassword.
parent
f86946d2
No related branches found
No related tags found
3 merge requests
!196
S25 - EiC submit revision
,
!189
S25
,
!183
Hin 961 strong password
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/component-user-manager/src/tests/users/changePassword.test.js
+5
-5
5 additions, 5 deletions
...onent-user-manager/src/tests/users/changePassword.test.js
with
5 additions
and
5 deletions
packages/component-user-manager/src/tests/users/changePassword.test.js
+
5
−
5
View file @
8e46e2c0
...
@@ -13,8 +13,8 @@ jest.mock('@pubsweet/component-send-email', () => ({
...
@@ -13,8 +13,8 @@ jest.mock('@pubsweet/component-send-email', () => ({
}))
}))
const
reqBody
=
{
const
reqBody
=
{
p
assword
:
'
password
'
,
currentP
assword
:
'
password
'
,
newP
assword
:
'
N3wPassword!
'
,
p
assword
:
'
N3wPassword!
'
,
}
}
const
notFoundError
=
new
Error
()
const
notFoundError
=
new
Error
()
...
@@ -44,7 +44,7 @@ describe('Users password reset route handler', () => {
...
@@ -44,7 +44,7 @@ describe('Users password reset route handler', () => {
expect
(
data
.
error
).
toEqual
(
'
Missing required params.
'
)
expect
(
data
.
error
).
toEqual
(
'
Missing required params.
'
)
})
})
it
(
'
should return an error when the password is too small
'
,
async
()
=>
{
it
(
'
should return an error when the password is too small
'
,
async
()
=>
{
body
.
newP
assword
=
'
small
'
body
.
p
assword
=
'
small
'
const
req
=
httpMocks
.
createRequest
({
body
})
const
req
=
httpMocks
.
createRequest
({
body
})
req
.
user
=
user
.
id
req
.
user
=
user
.
id
...
@@ -67,7 +67,7 @@ describe('Users password reset route handler', () => {
...
@@ -67,7 +67,7 @@ describe('Users password reset route handler', () => {
expect
(
data
.
error
).
toEqual
(
'
User not found
'
)
expect
(
data
.
error
).
toEqual
(
'
User not found
'
)
})
})
it
(
'
should return an error when the current password is incorrect
'
,
async
()
=>
{
it
(
'
should return an error when the current password is incorrect
'
,
async
()
=>
{
body
.
p
assword
=
'
invalid-password
'
body
.
currentP
assword
=
'
invalid-password
'
const
req
=
httpMocks
.
createRequest
({
body
})
const
req
=
httpMocks
.
createRequest
({
body
})
req
.
user
=
user
.
id
req
.
user
=
user
.
id
...
@@ -90,6 +90,6 @@ describe('Users password reset route handler', () => {
...
@@ -90,6 +90,6 @@ describe('Users password reset route handler', () => {
savedUser
.
validPassword
=
user
.
validPassword
savedUser
.
validPassword
=
user
.
validPassword
expect
(
savedUser
.
token
).
not
.
toEqual
(
user
.
token
)
expect
(
savedUser
.
token
).
not
.
toEqual
(
user
.
token
)
expect
(
savedUser
.
validPassword
(
body
.
newP
assword
)).
toBeTruthy
()
expect
(
savedUser
.
validPassword
(
body
.
p
assword
)).
toBeTruthy
()
})
})
})
})
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment