Skip to content

Commit

Permalink
fix: tests for the newly added features and reorganize old role test
Browse files Browse the repository at this point in the history
  • Loading branch information
jeandamas committed Mar 16, 2023
1 parent 49b04b1 commit 525a475
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/controllers/rolesPermissionControllers/__tests__/roles.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
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({
email: "[email protected]",
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);
});
});

0 comments on commit 525a475

Please sign in to comment.