-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement minimum length for passwords in account creation #4353
Merged
akolson
merged 12 commits into
learningequality:unstable
from
cerdo03:password-validation-surya
Aug 13, 2024
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
e25e153
password validation implemented in frontend
cerdo03 88d3527
Update contentcuration/contentcuration/frontend/accounts/pages/Create…
cerdo03 3c2670a
changes suggested by maintainers
cerdo03 e76340e
changes suggested by maintainers
cerdo03 ee4dd20
conflicts resolved
cerdo03 e1ab67c
testing changes
cerdo03 2837390
Merge branch 'unstable' of github.com:cerdo03/studio into password-va…
cerdo03 e81026d
Cleanup registration form handling
bjester 91af8c0
Consolidate 'This field is required' and handle registration form res…
bjester 4d2f325
Update frontend test for create page changes
bjester 8987146
Merge unstable
AlexVelezLl fca4046
Fix test
AlexVelezLl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,8 +17,8 @@ const defaultData = { | |
first_name: 'Test', | ||
last_name: 'User', | ||
email: '[email protected]', | ||
password1: 'pass', | ||
password2: 'pass', | ||
password1: 'tester123', | ||
password2: 'tester123', | ||
uses: ['tagging'], | ||
storage: '', | ||
other_use: '', | ||
|
@@ -126,6 +126,11 @@ describe('create', () => { | |
expect(register).not.toHaveBeenCalled(); | ||
}); | ||
}); | ||
it('should fail if password1 is too short', () => { | ||
const wrapper = makeWrapper({ password1: '123' }); | ||
wrapper.vm.submit(); | ||
expect(register).not.toHaveBeenCalled(); | ||
}); | ||
it('should fail if password1 and password2 do not match', () => { | ||
const wrapper = makeWrapper({ password1: 'some other password' }); | ||
wrapper.vm.submit(); | ||
|
@@ -155,7 +160,7 @@ describe('create', () => { | |
it('should say account with email already exists if register returns a 403', async () => { | ||
wrapper.setMethods({ register: makeFailedPromise(403) }); | ||
await wrapper.vm.submit(); | ||
expect(wrapper.vm.emailErrors).toHaveLength(1); | ||
expect(wrapper.vm.errors.email).toHaveLength(1); | ||
}); | ||
it('should say account has not been activated if register returns 405', async () => { | ||
wrapper.setMethods({ register: makeFailedPromise(405) }); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is nolonger necessary as
fieldRequired
exists. There's a few other places to clean this up too.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, this is required. The linting rule does not properly understand this is an external translator