diff options
| author | cjd24 | 2018-04-23 15:32:02 +0100 |
|---|---|---|
| committer | cjd24 | 2018-04-23 15:32:02 +0100 |
| commit | 3987d5068881341c27150e37eff1794a27901cac (patch) | |
| tree | 6165dff18f9f0a31e4eecec056d264732f99bdd0 /test/integration | |
| parent | PANIC COMMITS OMMGGGGG (diff) | |
| parent | ALL TESTS FIXXXXXXXED (diff) | |
| download | medicine-3987d5068881341c27150e37eff1794a27901cac.tar.gz medicine-3987d5068881341c27150e37eff1794a27901cac.zip | |
merge conflict
Diffstat (limited to 'test/integration')
| -rw-r--r-- | test/integration/auth.routes.test.ts | 4 | ||||
| -rw-r--r-- | test/integration/protocol.routes.test.ts | 19 |
2 files changed, 15 insertions, 8 deletions
diff --git a/test/integration/auth.routes.test.ts b/test/integration/auth.routes.test.ts index 29c0cfc..c090984 100644 --- a/test/integration/auth.routes.test.ts +++ b/test/integration/auth.routes.test.ts @@ -80,10 +80,10 @@ describe('authentication', () => { grant_type: 'password' }).then((res) => { // File-not-found is a valid response - expect(res).to.have.status(404); + expect(res).to.have.status(401); }).catch((reason) => { // Unauthorised is a valid response - expect(reason).to.have.status(401); + expect(reason).to.have.status(404); }); }); it('should reject invalid usernames', () => { diff --git a/test/integration/protocol.routes.test.ts b/test/integration/protocol.routes.test.ts index 77b39f0..d289de3 100644 --- a/test/integration/protocol.routes.test.ts +++ b/test/integration/protocol.routes.test.ts @@ -100,11 +100,12 @@ const completeProtocol: MochaForEachInput[] = [ 'debug', 'info', 'security', - 'warning', + 'warn', 'error', 'critical', 'success', - 'failure' + 'failure', + 'verbose' ]), message: types.anything, label: optional(types.string), @@ -215,8 +216,8 @@ const completeProtocol: MochaForEachInput[] = [ }, 200], ['post', '/projects/mocky2', {}, 200], ['get', '/projects/mocky/properties', null, 200], - ['post', '/projects/mocky/files/foler/file?action=overwrite', {}, 200], - ['get', '/projects/mocky/files/foler/file', null, 200] + ['post', '/projects/mocky/files/file?overwrite=true&truncate=true', {}, 200], + ['get', '/projects/mocky/files/file', null, 404] //['get', '/projects/mocky/files_by_id/file1', null, 200] ]; @@ -308,9 +309,12 @@ describe('routes : protocol', () => { describe('GET invalid routes', () => { // Should invalid routes also possibly be 401? - it.skip('should have response code 404', () => { + it('should have response code 404', () => { return chai.request(app).get('/invalid/route') .set('Authorization', `Bearer ${token}`) + .then((res: ChaiHttp.Response) => { + expect(res.status).to.equal(404); + }) .catch((err) => { expect(err.status).to.equal(404); }); @@ -326,9 +330,12 @@ describe('routes : protocol', () => { describe('POST invalid routes', () => { // Should invalid routes also possibly be 401? - it.skip('should have response code 404', () => { + it('should have response code 404', () => { return chai.request(app).post('/invalid/route') .set('Authorization', `Bearer ${token}`) + .then((res: ChaiHttp.Response) => { + expect(res.status).to.equal(404); + }) .catch((err) => { expect(err.status).to.equal(404); }); |
