Bug fix preventing deleteOneMsg from ever responding with 404 as well as adding the unit test for deleteOneMsg 404 response

This commit is contained in:
Gregory Campbell
2021-11-25 21:40:34 -05:00
parent b0d449d012
commit 1776e011f2
2 changed files with 14 additions and 2 deletions
+12
View File
@@ -159,6 +159,18 @@ describe('DELETE /msg/:id', function () {
done();
});
});
it('respond with 404 error', function (done) {
request(app)
.delete('/msg/idisnonexisting')
.set('Accept', 'application/json')
.expect(404) //expecting HTTP status code
.expect('Content-Type', /json/) // expecting content value
.end((err) => {
if (err) return done(err);
done();
});
});
});
describe('DELETE /msg', function () {