auto(agent): Add validation and tests for contacts route
This commit is contained in:
parent
7b5ffa06be
commit
254f71e98f
2 changed files with 24 additions and 0 deletions
|
|
@ -43,4 +43,13 @@ test('POST /contacts should validate contact data', async () => {
|
|||
});
|
||||
|
||||
assert.strictEqual(response.statusCode, 400);
|
||||
});
|
||||
|
||||
test('GET /contacts should return 401 for unauthorized access', async () => {
|
||||
const response = await app.inject({
|
||||
method: 'GET',
|
||||
url: '/contacts'
|
||||
});
|
||||
|
||||
assert.strictEqual(response.statusCode, 401);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue