File tree 1 file changed +25
-0
lines changed
src/controllers/rolesPermissionControllers/__tests__
1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change
1
+ import supertest from "supertest" ;
2
+ import createServer from "../../../utils/server" ;
3
+ /* eslint-disable @typescript-eslint/no-explicit-any */
4
+ const app = createServer ( ) ;
5
+ let token ;
6
+ beforeAll ( async ( ) => {
7
+ const res = await supertest ( app ) . post ( "/login" ) . send ( {
8
+
9
+ password : "adminpass" ,
10
+ } ) ;
11
+ token = res . body . token ;
12
+ } , 40000 ) ;
13
+
14
+ describe ( "Admin Manage roles" , ( ) => {
15
+ describe ( "Authorised Access" , ( ) => {
16
+ test ( "View All Roles" , async ( ) => {
17
+ const response = await supertest ( app ) . get ( "/role" ) ;
18
+ expect ( response . status ) . toBe ( 404 ) ;
19
+ } , 60000 ) ;
20
+ test ( "Get role by name" , async ( ) => {
21
+ const response = await supertest ( app ) . get ( "/role/admin" ) ;
22
+ expect ( response . status ) . toBe ( 404 ) ;
23
+ } , 60000 ) ;
24
+ } ) ;
25
+ } ) ;
You can’t perform that action at this time.
0 commit comments