-
Notifications
You must be signed in to change notification settings - Fork 10
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
#167891575 Implements Descriptive Signup/Registration Errors #15
Conversation
4b48cfa
to
d2ec6fe
Compare
@@ -21,7 +21,7 @@ if (config.use_env_variable) { | |||
} | |||
|
|||
fs.readdirSync(__dirname) | |||
.filter(file => (file | |||
.filter((file) => (file |
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.
Unexpected parentheses around single function argument having a body with no curly braces arrow-parens
d2ec6fe
to
6bcbf8b
Compare
test/routes/auth.test.js
Outdated
@@ -0,0 +1,29 @@ | |||
import chai, { should } from 'chai'; | |||
import chaiHttp from 'chai-http'; |
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.
'chaiHttp' is defined but never used no-unused-vars
const formatWord = word | ||
.toLowerCase() | ||
.split(' ') | ||
.map((f) => f.charAt(0).toUpperCase() + f.substring(1)) |
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.
Unexpected parentheses around single function argument having a body with no curly braces arrow-parens
6bcbf8b
to
febcfd3
Compare
defaultValue: Sequelize.fn('now') | ||
} | ||
})), | ||
down: (queryInterface) => queryInterface.dropTable('Users') |
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.
Unexpected parentheses around single function argument having a body with no curly braces arrow-parens
05593a7
to
aa25c73
Compare
expect(res.body.message).to.eql('Validation Error!'); | ||
expect(res.body.data.gender).to.eql( | ||
'Male or Female is the accepted value' | ||
); |
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.
Unexpected newline before ')' function-paren-newline
expect(res.body.message).to.eql('Validation Error!'); | ||
expect(res.body.data.gender).to.eql( | ||
'Male or Female is the accepted value' | ||
); |
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.
Unexpected newline before ')' function-paren-newline
.end((err, res) => { | ||
expect(res).to.have.status(400); | ||
expect(res.body.message).to.eql('Validation Error!'); | ||
expect(res.body.data.gender).to.eql( |
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.
Unexpected newline after '(' function-paren-newline
expect(res.body.message).to.eql('Validation Error!'); | ||
expect(res.body.data.dob).to.eql( | ||
'Users must be 18 and above' | ||
); |
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.
Unexpected newline before ')' function-paren-newline
.end((err, res) => { | ||
expect(res).to.have.status(400); | ||
expect(res.body.message).to.eql('Validation Error!'); | ||
expect(res.body.data.password).to.eql( |
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.
Unexpected newline after '(' function-paren-newline
expect(res.body.message).to.eql('Validation Error!'); | ||
expect(res.body.data.email).to.eql( | ||
'Email address is invalid' | ||
); |
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.
Unexpected newline before ')' function-paren-newline
.end((err, res) => { | ||
expect(res).to.have.status(400); | ||
expect(res.body.message).to.eql('Validation Error!'); | ||
expect(res.body.data.email).to.eql( |
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.
Unexpected newline after '(' function-paren-newline
expect(res.body.message).to.eql('Validation Error!'); | ||
expect(res.body.data.lastName).to.eql( | ||
'Last name should only contain alphabets' | ||
); |
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.
Unexpected newline before ')' function-paren-newline
.end((err, res) => { | ||
expect(res).to.have.status(400); | ||
expect(res.body.message).to.eql('Validation Error!'); | ||
expect(res.body.data.lastName).to.eql( |
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.
Unexpected newline after '(' function-paren-newline
aa25c73
to
7223882
Compare
accumulator[key] = value.msg; | ||
return accumulator; | ||
}, {}, | ||
); |
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.
Unexpected newline before ')' function-paren-newline
req = { ...req, ...matchedData(req) }; | ||
|
||
if (!errors.isEmpty()) { | ||
const mapErrors = Object.entries(errors.mapped()).reduce( |
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.
Unexpected newline after '(' function-paren-newline
.isAlphanumeric() | ||
.withMessage( | ||
'Password must be alphanumeric and not be less than 8 characters' | ||
), |
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.
Unexpected newline before ')' function-paren-newline
.isLength({ min: 8, }) | ||
.withMessage('Password must be alphanumeric and not be less than 8 characters') | ||
.isAlphanumeric() | ||
.withMessage( |
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.
Unexpected newline after '(' function-paren-newline
expect(res.body.message).to.eql('Validation Error!'); | ||
expect(res.body.data.lastName).to.eql( | ||
'Last name should be between 2 to 15 characters' | ||
); |
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.
Unexpected newline before ')' function-paren-newline
.end((err, res) => { | ||
expect(res).to.have.status(400); | ||
expect(res.body.message).to.eql('Validation Error!'); | ||
expect(res.body.data.firstName).to.eql( |
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.
Unexpected newline after '(' function-paren-newline
expect(res.body.message).to.eql('Validation Error!'); | ||
expect(res.body.data.firstName).to.eql( | ||
'First name should be between 2 to 15 characters' | ||
); |
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.
Unexpected newline before ')' function-paren-newline
.end((err, res) => { | ||
expect(res).to.have.status(400); | ||
expect(res.body.message).to.eql('Validation Error!'); | ||
expect(res.body.data.firstName).to.eql( |
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.
Unexpected newline after '(' function-paren-newline
expect(res).to.have.status(409); | ||
expect(res.body.message).to.eql( | ||
'User with email address already exist', | ||
); |
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.
Unexpected newline before ')' function-paren-newline
.send(user) | ||
.end((err, res) => { | ||
expect(res).to.have.status(409); | ||
expect(res.body.message).to.eql( |
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.
Unexpected newline after '(' function-paren-newline
7223882
to
09e171c
Compare
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.
Nice Job!
I like your creativity. However, I think your middleware/validator.js
could be simpler. Please check express-validator website.
09e171c
to
5e66a6a
Compare
[Starts #167891575]
5e66a6a
to
8e9ea9f
Compare
What does this PR do?
Description of Task to be completed?
* Display error message when a user tries to signup with an already existing email* Write testsfeature using SwaggerHow should this manually be Tested?
ft-signup-validation-167891575
npm i
npm test
What are the relevant Pivotal Tracker stories?
#167891575
Screenshots (if appropriate)