Skip to content

Commit

Permalink
fix: incorrect test mock
Browse files Browse the repository at this point in the history
  • Loading branch information
williams-jack committed Aug 8, 2024
1 parent a769791 commit deb03c0
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ describe('get all grading jobs in the queue', () => {
const configs = generateJobConfigs(2);
const queueInfos = generateMultipleMockQueueInfos(configs, true);
mockPrismaInstance.reservation.findMany.mockResolvedValue(queueInfos.map((q) => ({ ...q.reservation, job: q.job })));
mockPrismaInstance.job.findMany.mockResolvedValue(queueInfos.map((q) => q.job));
// the getAllGradingJobs function only calls job.findMany with a list of
// submitter IDs from the provided reservations. These are all immediate
// jobs in this case, meaning that there would be _zero_ reservations with
// submitter IDs on these reservations.
mockPrismaInstance.job.findMany.mockResolvedValue([]);
await expect(getAllGradingJobs().then((jobs) => jobs.map((j) => j.key))).resolves.toEqual(configs.map((c) => c.key));
});
it('returns both submitter and immediate jobs in order of release at', async () => {
Expand Down

0 comments on commit deb03c0

Please sign in to comment.