Skip to content

Commit 525a475

Browse files
committed
fix: tests for the newly added features and reorganize old role test
1 parent 49b04b1 commit 525a475

File tree

1 file changed

+25
-0
lines changed
  • src/controllers/rolesPermissionControllers/__tests__

1 file changed

+25
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
});

0 commit comments

Comments
 (0)