From f978ce8a97d7f1a9ed18b5849e26e35607f240f5 Mon Sep 17 00:00:00 2001 From: sggerard Date: Mon, 16 Dec 2024 16:52:19 -0800 Subject: [PATCH] Add supporting document to test, update snap --- .../projectSummary/DocumentUpload.spec.tsx | 2 +- .../ProjectSummaryFormComponents.spec.tsx | 10 +- .../ProjectDocumentsTab.spec.tsx.snap | 647 ++++++++++++++++++ 3 files changed, 655 insertions(+), 4 deletions(-) diff --git a/services/common/src/components/projectSummary/DocumentUpload.spec.tsx b/services/common/src/components/projectSummary/DocumentUpload.spec.tsx index 50a3573a0e..1629b9ba2e 100644 --- a/services/common/src/components/projectSummary/DocumentUpload.spec.tsx +++ b/services/common/src/components/projectSummary/DocumentUpload.spec.tsx @@ -28,7 +28,7 @@ describe("DocumentUpload", () => { initialValues={MOCK.PROJECT_SUMMARY} onSubmit={() => { }} > - + ); diff --git a/services/common/src/components/projectSummary/ProjectSummaryFormComponents.spec.tsx b/services/common/src/components/projectSummary/ProjectSummaryFormComponents.spec.tsx index eed0b58d89..bd085eee6d 100644 --- a/services/common/src/components/projectSummary/ProjectSummaryFormComponents.spec.tsx +++ b/services/common/src/components/projectSummary/ProjectSummaryFormComponents.spec.tsx @@ -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 }; @@ -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 }; diff --git a/services/common/src/components/projects/__snapshots__/ProjectDocumentsTab.spec.tsx.snap b/services/common/src/components/projects/__snapshots__/ProjectDocumentsTab.spec.tsx.snap index c9932139cf..241d64c04e 100644 --- a/services/common/src/components/projects/__snapshots__/ProjectDocumentsTab.spec.tsx.snap +++ b/services/common/src/components/projects/__snapshots__/ProjectDocumentsTab.spec.tsx.snap @@ -44,6 +44,29 @@ exports[`ProjectDocumentsTab renders properly 1`] = ` + +
+
+
+

+ Air Emissions Discharge Permit +

+
+
+
+
+
+ +
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ + + File Name + + + + + + + + + + + + +
+
+ Category + +
+ + File Type + + + + + + + + + + + +
+
+
+ + Last Modified + + + + + + + + + + + +
+
+
+ + Created By + + + + + + + + + + + +
+
+
+ + + + + +
+ N/A +
+
+
+ .png +
+
+
+ Dec 12 2024 +
+
+
+ idir\\username +
+
+
+ +
+
+ + + + + +
+ N/A +
+
+
+ .pdf +
+
+
+ Dec 12 2024 +
+
+
+ idir\\username +
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+