feat: Add role-based access control tests and template
Some checks are pending
Docker Test / test (push) Waiting to run
Some checks are pending
Docker Test / test (push) Waiting to run
This commit is contained in:
parent
6f047d44d3
commit
d55672539f
1 changed files with 2 additions and 1 deletions
|
|
@ -25,9 +25,10 @@ describe('Role-based Access Control', () => {
|
||||||
.expect(401);
|
.expect(401);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Test that protected routes require correct role
|
||||||
it('should return 403 for authenticated user without required role', async () => {
|
it('should return 403 for authenticated user without required role', async () => {
|
||||||
// This would require setting up a mock user with a specific role
|
// This would require setting up a mock user with a specific role
|
||||||
// and making a request to a protected route
|
// and making a request to a route that requires admin role
|
||||||
const response = await request(app)
|
const response = await request(app)
|
||||||
.get('/api/admin/users')
|
.get('/api/admin/users')
|
||||||
.expect(403);
|
.expect(403);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue