Skip to content

Commit

Permalink
chore: add another test
Browse files Browse the repository at this point in the history
  • Loading branch information
RishikeshNK committed Nov 22, 2024
1 parent efc3a25 commit f9f61a2
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion packages/api/tests/review.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/unbound-method */
import { beforeEach, describe, expect, test, vi } from "vitest";

import type { Session } from "@cooper/auth";
import type { ReviewType } from "@cooper/db/schema";
import { desc } from "@cooper/db";
import { and, desc, eq } from "@cooper/db";
import { db } from "@cooper/db/client";
import { Review } from "@cooper/db/schema";

Expand Down Expand Up @@ -55,4 +56,17 @@ describe("Review Router", async () => {
where: undefined,
});
});

test("list endpoint with cycle filter", async () => {
await caller.review.list({
options: {
cycle: "SPRING",
},
});

expect(db.query.Review.findMany).toHaveBeenCalledWith({
orderBy: expect.anything(),
where: and(eq(Review.workTerm, "SPRING")),
});
});
});

0 comments on commit f9f61a2

Please sign in to comment.