Skip to content

Commit

Permalink
Fix reviews service test bug (#22)
Browse files Browse the repository at this point in the history
* Fix reviews service tests bug

* Linting
  • Loading branch information
AJaccP authored Jul 4, 2024
1 parent 39e6170 commit 1d0ded6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/challenges-platform/services/reviews-service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,21 @@ describe("ReviewsService", () => {
});
describe("when review does not exist", () => {
it("returns an error", async () => {
const invalidUuid = "invalid-uuid";
const result = await ReviewsService.findByUuid(invalidUuid);
const testUuid = uuid.create();
const result = await ReviewsService.findByUuid(testUuid);

expect(result.err).toBe(true);
expect(result.val.toString()).toBe("Error: Invalid UUID");
expect(result.val.toString()).toBe("Error: Review not found");
});
});

describe("when uuid is invalid", () => {
it("returns an error", async () => {
const testUuid = uuid.create();
const result = await ReviewsService.findByUuid(testUuid);
const invalidUuid = "invalid-uuid";
const result = await ReviewsService.findByUuid(invalidUuid);

expect(result.err).toBe(true);
expect(result.val.toString()).toBe("Error: Review not found");
expect(result.val.toString()).toBe("Error: Invalid UUID");
});
});
});
Expand Down

0 comments on commit 1d0ded6

Please sign in to comment.