Skip to content

Commit

Permalink
Fix error in test
Browse files Browse the repository at this point in the history
  • Loading branch information
ebenezerdon committed Nov 21, 2018
1 parent 6ca0268 commit f2b39a9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 1 addition & 3 deletions server/routes/middleware/validateinput.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
const validateUserInput = (req, res, next) => {
const {
body,
} = req;
const { body } = req;

if (!String(body.emailAddress)) {
return res.status(400).json({
Expand Down
4 changes: 2 additions & 2 deletions server/tests/sales.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('Get sales', () => {
});
});
});
it('it should return status 401 if id not valid', (done) => {
it('it should return status 400 if id not valid', (done) => {
chai.request(app).post('/api/v1/auth/login')
.send({
emailaddress: 'admin@gmail.com',
Expand All @@ -72,7 +72,7 @@ describe('Get sales', () => {
.get('/api/v1/sales/d')
.set('accesstoken', token)
.end((error, data) => {
expect(data).to.have.status(401);
expect(data).to.have.status(400);
done();
});
});
Expand Down
4 changes: 2 additions & 2 deletions server/tests/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('Get users', () => {
});
});
});
it('it should return status 401 if id not valid', (done) => {
it('it should return status 400 if id not valid', (done) => {
chai.request(app).post('/api/v1/auth/login')
.send({
emailaddress: 'admin@gmail.com',
Expand All @@ -54,7 +54,7 @@ describe('Get users', () => {
.get('/api/v1/users/d')
.set('accesstoken', token)
.end((error, data) => {
expect(data).to.have.status(401);
expect(data).to.have.status(400);
done();
});
});
Expand Down

0 comments on commit f2b39a9

Please sign in to comment.