-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
undo manually adding Angelas changes
- Loading branch information
Rocio De Santiago
authored and
Rocio De Santiago
committed
Jan 27, 2025
1 parent
b9c3db1
commit f10f2a2
Showing
8 changed files
with
40 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,11 +7,6 @@ jest.mock("../../storage/reports", () => ({ | |
putReport: () => putMock(), | ||
})); | ||
|
||
const validateReportPayloadMock = jest.fn(); | ||
jest.mock("../../utils/reportValidation", () => ({ | ||
validateReportPayload: () => validateReportPayloadMock(), | ||
})); | ||
|
||
describe("Test create report handler", () => { | ||
beforeEach(() => { | ||
jest.clearAllMocks(); | ||
|
@@ -25,7 +20,8 @@ describe("Test create report handler", () => { | |
} as User; | ||
const reportOptions = { | ||
name: "report1", | ||
} as ReportOptions; | ||
year: 2026, | ||
} as unknown as ReportOptions; | ||
const report = await buildReport( | ||
ReportType.QMS, | ||
state, | ||
|
@@ -40,29 +36,3 @@ describe("Test create report handler", () => { | |
expect(putMock).toHaveBeenCalled(); | ||
}); | ||
}); | ||
|
||
describe("Test validation error", () => { | ||
beforeEach(() => { | ||
jest.clearAllMocks(); | ||
}); | ||
|
||
test("Test that a validation failure throws invalid request error", async () => { | ||
// Manually throw validation error | ||
validateReportPayloadMock.mockImplementation(() => { | ||
throw new Error("you be havin some validatin errors"); | ||
}); | ||
|
||
const state = "PA"; | ||
const user = { | ||
fullName: "James Holden", | ||
email: "[email protected]", | ||
} as User; | ||
const reportOptions = { | ||
name: "report1", | ||
} as ReportOptions; | ||
|
||
expect(async () => { | ||
await buildReport(ReportType.QMS, state, reportOptions, user); | ||
}).rejects.toThrow("Invalid request"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,8 @@ export const validReport: Report = { | |
lastEditedByEmail: "[email protected]", | ||
status: ReportStatus.NOT_STARTED, | ||
name: "yeehaw", | ||
year: 2026, | ||
options: {}, | ||
}; | ||
|
||
export const missingStateReport = { | ||
|
@@ -164,21 +166,3 @@ export const invalidRadioCheckedChildrenReport = { | |
}, | ||
} as Record<MeasureTemplateName, MeasurePageTemplate>, | ||
}; | ||
|
||
export const invalidPageElementType = { | ||
...validReport, | ||
pages: [ | ||
{ | ||
id: "general-info", | ||
title: "General Info", | ||
type: PageType.Standard, | ||
sidebar: true, | ||
elements: [ | ||
{ | ||
type: "badElementType", // Doesn't use ElementType enum | ||
text: "State of Program Information", | ||
}, | ||
], | ||
}, | ||
], | ||
}; |
Oops, something went wrong.