From 2ff80f1b4c64e1ca3e648b0d7e58ed8f30dd1504 Mon Sep 17 00:00:00 2001 From: Saddock Kabandana Date: Sat, 25 May 2024 17:21:46 +0200 Subject: [PATCH] Admin should be able to disable or enable an account --- src/modules/user/test/user.spec.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/modules/user/test/user.spec.ts b/src/modules/user/test/user.spec.ts index 69432439..b55d1c29 100644 --- a/src/modules/user/test/user.spec.ts +++ b/src/modules/user/test/user.spec.ts @@ -1,20 +1,20 @@ // user Tests import chai, { expect } from "chai"; import chaiHttp from "chai-http"; -import app from "../../../index"; // Adjust the path to your app's entry point +import app from "../../../index"; chai.use(chaiHttp); const router = () => chai.request(app); -const testUserId = 1; // Example user ID for testing +const testUserId = 1; describe("User Account Status Management", () => { describe("Disable User Account", () => { it("Should return 404 if user doesn't exist", (done) => { router() - .put("/api/admin-change-status/disable/100000") // Non-existent user ID + .put("/api/admin-change-status/disable/100000") .end((err, res) => { expect(res).to.have.status(404); expect(res.body).to.be.an("object"); @@ -38,7 +38,7 @@ describe("User Account Status Management", () => { it("Should handle server errors", (done) => { router() - .put("/api/admin-change-status/disable/invalid_id") // Invalid user ID + .put("/api/admin-change-status/disable/invalid_id") .end((err, res) => { expect(res).to.have.status(500); expect(res.body).to.be.an("object"); @@ -52,7 +52,7 @@ describe("User Account Status Management", () => { describe("Enable User Account", () => { it("Should return 404 if user doesn't exist", (done) => { router() - .put("/api/admin-change-status/enable/100000") // Non-existent user ID + .put("/api/admin-change-status/enable/100000") .end((err, res) => { expect(res).to.have.status(404); expect(res.body).to.be.an("object"); @@ -76,7 +76,7 @@ describe("User Account Status Management", () => { it("Should handle server errors", (done) => { router() - .put("/api/admin-change-status/enable/invalid_id") // Invalid user ID + .put("/api/admin-change-status/enable/invalid_id") .end((err, res) => { expect(res).to.have.status(500); expect(res.body).to.be.an("object");