Skip to content

Commit

Permalink
CMDCT-4190: banner edit and adidng test in report create
Browse files Browse the repository at this point in the history
  • Loading branch information
angelaco11 committed Dec 23, 2024
1 parent b44c122 commit f45ffc5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions services/app-api/handlers/banners/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ const validationSchema = object().shape({
title: string().required(),
description: string().required(),
link: string().url().notRequired(),
startDate: number().required(),
endDate: number().required(),
startDate: number().notRequired(),
endDate: number().notRequired(),
});

export const createBanner = handler(parseBannerId, async (request) => {
Expand Down
9 changes: 9 additions & 0 deletions services/app-api/handlers/reports/create.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,12 @@ describe("Test create report handler", () => {
expect(res.statusCode).toBe(StatusCodes.Ok);
});
});

test("Test invalid report type", async () => {
const invalidDataEvent = {
...proxyEvent,
pathParameters: { reportType: "BM", state: "NM" },
} as APIGatewayProxyEvent;
const res = await createReport(invalidDataEvent);
expect(res.statusCode).toBe(StatusCodes.BadRequest);
});

0 comments on commit f45ffc5

Please sign in to comment.