Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] fixed issues with all present testcases #313

Merged
merged 1 commit into from
Sep 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion controller/infrastructure.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ async function addInfrastructure(req, res) {
} = req.body;
try {
const newInfrastructure = await createInfrastructure(name, type, wing, floor, capacity);
res.json({ res: `added user ${newInfrastructure.id}` });
res.json({ res: `added infrastructure ${newInfrastructure.id}` });
} catch (error) {
logger.error("Error while inserting", error);
res.status(500);
Expand Down
5 changes: 3 additions & 2 deletions test/routes/accreditation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ describe("checking accreditation functions", () => {

it("read accreditation", async () => {
const response = await agent
.post("/accreditation/list")
.get("/accreditation/list")
.send({ name: "xyz" });
expect(response.body.res).not.toBeNull();
expect(response.status).toBe(200);
expect(response.body.res).toBeDefined();
});

it("update accreditation", async () => {
Expand Down
7 changes: 4 additions & 3 deletions test/routes/infrastructure.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe("Infrastructure API", () => {
});

expect(response.status).toBe(200);
expect(response.body.res).toMatch(/added user/);
expect(response.body.res).toMatch(/added infrastructure/);
});

describe("after adding infrastructure", () => {
Expand All @@ -78,9 +78,10 @@ describe("Infrastructure API", () => {

it("should read infrastructure", async () => {
const response = await agent
.post("/infrastructure/list")
.get("/infrastructure/list")
.send({ name: "Building A" });
expect(response.body.res).not.toBeNull();
expect(response.status).toBe(200);
expect(response.body.res).toBeDefined();
});

it("should update infrastructure", async () => {
Expand Down