diff --git a/frontend/packages/yki/src/tests/msw/handlers.ts b/frontend/packages/yki/src/tests/msw/handlers.ts index 788ffeb1e..4c9df6723 100644 --- a/frontend/packages/yki/src/tests/msw/handlers.ts +++ b/frontend/packages/yki/src/tests/msw/handlers.ts @@ -9,6 +9,17 @@ export const handlers = [ rest.get(APIEndpoints.Evaluations, (_, res, ctx) => { return res(ctx.status(200), ctx.json(evaluationPeriods)); }), + rest.get(APIEndpoints.Evaluation, (req, res, ctx) => { + const { evaluationId } = req.params; + const evaluationPeriod = evaluationPeriods.evaluation_periods.filter( + (ep) => ep.id === Number(evaluationId) + )[0]; + if (evaluationPeriod) { + return res(ctx.status(200), ctx.json(evaluationPeriod)); + } else { + return res(ctx.status(404)); + } + }), rest.get(APIEndpoints.ExamSessions, (_, res, ctx) => { return res(ctx.status(200), ctx.json(examSessions)); }),