Skip to content

Commit c17a88a

Browse files
committed
fix
1 parent 6b37435 commit c17a88a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/routes/attendance.test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ beforeAll((done) => {
1717
});
1818

1919
function cleanUp(callback) {
20-
attendanceModel.remove({ name: "xyz" }).then(() => {
20+
attendanceModel.remove({ student: "xyz" }).then(() => {
2121
connector.disconnect((DBerr) => {
2222
if (DBerr) console.log("Database dissconnnect error: ", DBerr);
2323
server.close((serverErr) => {
@@ -35,7 +35,7 @@ afterAll((done) => {
3535
describe("checking attendance functions", () => {
3636
it("create attendance", async () => {
3737
const response = await agent.post("/attendance/add").send({
38-
name: "xyz",
38+
student: "xyz",
3939
course: "XYZ",
4040
monthlyAttended: 123,
4141
monthlyOccured: 123,
@@ -49,7 +49,7 @@ describe("checking attendance functions", () => {
4949
let id;
5050
beforeEach(async () => {
5151
id = await agent.post("/attendance/add").send({
52-
name: "xyz",
52+
student: "xyz",
5353
course: "XYZ",
5454
monthlyAttended: 123,
5555
monthlyOccured: 123,
@@ -60,21 +60,21 @@ describe("checking attendance functions", () => {
6060
});
6161

6262
afterEach(async () => {
63-
await attendanceModel.remove({ name: "xyz" });
63+
await attendanceModel.remove({ student: "xyz" });
6464
});
6565

6666
it("read attendance", async () => {
6767
const response = await agent
6868
.get("/attendance/list")
69-
.send({ name: "xyz" });
69+
.send({ student: "xyz" });
7070
expect(response.status).toBe(200);
7171
expect(response.body.res).toBeDefined();
7272
});
7373

7474
it("update attendance", async () => {
7575
const response = await agent
7676
.post(`/attendance/update/${id}`)
77-
.send({ name: "xyz" }, { name: "123" });
77+
.send({ student: "xyz" }, { student: "123" });
7878
expect(response.headers["content-type"]).toMatch(/json/);
7979
expect(response.status).toBe(200);
8080
expect(response.body.res).toMatch(/attendance updated/);

0 commit comments

Comments
 (0)