Skip to content

Commit

Permalink
Finished refactoring company enablement tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Naapperas committed Jun 20, 2023
1 parent 623d81a commit d4519cd
Show file tree
Hide file tree
Showing 2 changed files with 263 additions and 193 deletions.
18 changes: 18 additions & 0 deletions test/end-to-end/company/:id/disable.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ describe("PUT /company/disable", () => {

const test_agent = agent();

beforeAll(async () => {
await Company.deleteMany({});
await Offer.deleteMany({});
await Account.deleteMany({});
});

afterAll(async () => {
await Company.deleteMany({});
await Offer.deleteMany({});
await Account.deleteMany({});
});

describe("ID Validation", () => {
test("Should fail if id is not a valid ObjectID", async () => {
const id = "123";
Expand Down Expand Up @@ -154,6 +166,12 @@ describe("PUT /company/disable", () => {
});
});

afterEach(async () => {
await test_agent
.delete("/auth/login")
.expect(StatusCodes.OK);
});

test("should fail to disable company if logged as different company", async () => {

await test_agent
Expand Down
Loading

0 comments on commit d4519cd

Please sign in to comment.