Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
41 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const request = require('supertest') | ||
const app = require('../app') | ||
|
||
describe('Post new application', () => { | ||
it('should create a new application', async () => { | ||
const res = await request(app.callback()) | ||
.post('/api/v1/applications/all') | ||
.send({ | ||
firstName: 'random_11223', | ||
lastName: 'guy_1222', | ||
email: 'random@example.com', | ||
address: '32 Mane Road' | ||
}) | ||
expect(res.statusCode).toEqual(201) | ||
expect(res.body).toHaveProperty('created', true) | ||
}) | ||
}); | ||
|
||
describe('Get all applications', () => { | ||
it('should show all applications', async () => { | ||
const res = await request(app.callback()) | ||
.get('/api/v1/applications/all') | ||
expect(res.statusCode).toEqual(200) | ||
}) | ||
}); | ||
|
||
describe('Get all users', () => { | ||
it('should show all users', async () => { | ||
const res = await request(app.callback()) | ||
.get('/api/v1/users') | ||
expect(res.statusCode).toEqual(401) | ||
}) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters