-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathroles.test.ts
29 lines (28 loc) · 1011 Bytes
/
roles.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import supertest from "supertest";
import createServer from "../../../utils/server";
/* eslint-disable @typescript-eslint/no-explicit-any */
const app = createServer();
let token;
beforeAll(async () => {
const res = await supertest(app).post("/login").send({
password: "adminpass",
});
token = res.body.token;
}, 40000);
describe("Admin Manage roles", () => {
describe("Authorised Access", () => {
test("View All Roles", async () => {
const response = await supertest(app).get("/role");
expect(response.status).toBe(404);
}, 60000);
test("Get role by name", async () => {
const response = await supertest(app).get("/role/admin");
expect(response.status).toBe(404);
}, 60000);
test("Delete role by name", async () => {
const response = await supertest(app).get("/role/abc");
expect(response.status).toBe(404);
}, 60000);
});
});