Skip to content

Commit

Permalink
Merge pull request #83 from agiledev-students-fall2023/test-home-and-…
Browse files Browse the repository at this point in the history
…login

Test home and login
  • Loading branch information
elaineZhang67 authored Nov 14, 2023
2 parents 92f3e39 + b016329 commit ec160f9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 21 deletions.
File renamed without changes.
24 changes: 24 additions & 0 deletions back-end/test/loginRoute.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const chai = require("chai");
const chaiHttp = require("chai-http");
const app = require("../app");
const expect = chai.expect;

chai.use(chaiHttp);

describe("POST for Login", () => {
describe("POST /", () => {
it("should return a success response", (done) => {
chai
.request(app)
.post("/")
.send({ username: "testuser", password: "testpassword" })
.end((err, res) => {
expect(res).to.have.status(200);
expect(res.body).to.be.a("object");
expect(res.body).to.have.property("status", "Success");
expect(res.body).to.have.property("message");
done();
});
});
});
});
21 changes: 0 additions & 21 deletions back-end/tests/loginTest.js

This file was deleted.

0 comments on commit ec160f9

Please sign in to comment.