-
Notifications
You must be signed in to change notification settings - Fork 7
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
#167727627 Set up Sign Up Validations #26
Conversation
f110390
to
73c3e55
Compare
73c3e55
to
f1070c6
Compare
f3ba926
to
9e84f5e
Compare
8fb82ad
to
c295cc5
Compare
it('should throw error 400 when user signs up with a null email and null password', (done) => { | ||
runTest(done); | ||
}); | ||
}); |
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.
you would need to re-write your tests because I don't understand the tests you wrote.
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.
Since all my tests are the same code, instead of repeating it, I encapsulated it in a function.
Line 37
const runTest = (done, object = {}) => {
chai
.request(server)
.post(route)
.send(object)
.then(res => {
expect(res).to.have.status(400);
const { body } = res;
expect(body).to.be.an('object');
expect(body).to.have.property('error');
const { status } = body;
expect(status).to.eql(res.status);
done();
})
.catch(done);
};
4e5bdfb
to
97f9b0a
Compare
97f9b0a
to
b70dd37
Compare
runTest(done, nullPassword); | ||
}); | ||
|
||
it('should throw error 400 when user signs up with a null email and null password', done => { |
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.
Line 79 exceeds the maximum line length of 80 max-len
runTest(done, nonAlphaNumPassword); | ||
}); | ||
|
||
it('should throw error 400 when user signs up with an invalid email', done => { |
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.
Line 67 exceeds the maximum line length of 80 max-len
runTest(done, shortPassword); | ||
}); | ||
|
||
it('should throw error 400 when user signs up with a non-alphanumeric password', done => { |
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.
Line 63 exceeds the maximum line length of 80 max-len
runTest(done, validUser); | ||
}); | ||
|
||
it('should throw error 400 when user signs up with a short password', done => { |
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.
Line 59 exceeds the maximum line length of 80 max-len
fs.readdirSync(__dirname) | ||
.filter( | ||
file => file.indexOf('.') !== 0 && file !== basename && file.slice(-3) === '.js' | ||
) |
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
.forEach((file) => { | ||
fs.readdirSync(__dirname) | ||
.filter( | ||
file => file.indexOf('.') !== 0 && file !== basename && file.slice(-3) === '.js' |
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.
Line 23 exceeds the maximum line length of 80 max-len
.filter((file) => (file.indexOf('.') !== 0) && (file !== basename) && (file.slice(-3) === '.js')) | ||
.forEach((file) => { | ||
fs.readdirSync(__dirname) | ||
.filter( |
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
}, | ||
{ | ||
classMethods: { | ||
associate: (models) => { |
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 arrow-parens
[Starts #167727627]
b70dd37
to
0b2f484
Compare
#167727627 Set up Sign Up Validations
What does this PR do?
Set up sign up validations
Description of Task to be completed?
Return error with status code of 400 when user signs up with:
How should this be manually tested?
cd
into the project directoryyarn install
to install the project's dependencyyarn test
to start the appWhat are the relevant pivotal tracker stories?
#167727627