Skip to content

Commit

Permalink
Add supporting document to test, update snap
Browse files Browse the repository at this point in the history
  • Loading branch information
sggerard committed Dec 17, 2024
1 parent 3ae873a commit f978ce8
Show file tree
Hide file tree
Showing 3 changed files with 655 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe("DocumentUpload", () => {
initialValues={MOCK.PROJECT_SUMMARY}
onSubmit={() => { }}
>
<DocumentUpload docFieldsDisabled={false} fieldsDisabled={false}/>
<DocumentUpload docFieldsDisabled={false} deleteEnabled={false}/>
</FormWrapper>
</ReduxWrapper>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,12 +285,16 @@ describe("ProjectSummaryForm components disable accurately according to function
};

const openModalSpy = jest.spyOn(modalActions, "openModal");
const keys = MOCK.PROJECT_SUMMARY.authorizations.flatMap(auth => auth.amendment_documents.map(doc => doc.document_manager_guid));
const keys = [
...MOCK.PROJECT_SUMMARY.authorizations.flatMap(auth => auth.amendment_documents.map(doc => doc.document_manager_guid)),
...MOCK.PROJECT_SUMMARY.documents.filter(doc => doc.project_summary_document_type_code === "SPR").map(doc => doc.document_manager_guid)
];

afterEach(() => {
jest.clearAllMocks();
});

test("Amendment document deletion enabled", async () => {
test("Document deletion enabled", async () => {
const params = {
deletionEnabled: true
};
Expand All @@ -313,7 +317,7 @@ describe("ProjectSummaryForm components disable accurately according to function
expect(openModalSpy).toHaveBeenCalledTimes(keys.length)
});

test("Amendment document deletion disabled", async () => {
test("Document deletion disabled", async () => {
const params = {
deletionEnabled: false
};
Expand Down
Loading

0 comments on commit f978ce8

Please sign in to comment.