diff --git a/services/ui-src/src/components/export/ExportedModalOverlayReportSection.test.tsx b/services/ui-src/src/components/export/ExportedModalOverlayReportSection.test.tsx
index 725da4b56..ff0f2fa3e 100644
--- a/services/ui-src/src/components/export/ExportedModalOverlayReportSection.test.tsx
+++ b/services/ui-src/src/components/export/ExportedModalOverlayReportSection.test.tsx
@@ -6,7 +6,6 @@ import {
} from "utils/testing/setupJest";
import {
mockSARReportWithOverlays,
- mockWPReportWithOtherTypeOverlays,
mockWPReportWithOverlays,
} from "utils/testing/mockReport";
import {
@@ -336,9 +335,10 @@ describe("", () => {
test("should render correct initiative topic", () => {
mockedUseStore.mockReturnValue({
...mockReportStore,
- report: mockWPReportWithOtherTypeOverlays,
+ report: mockWPReportWithOverlays,
});
render(testComponent(wpMockProps));
+ expect(screen.getByText("mock WP topic")).toBeInTheDocument();
expect(screen.getByText("Unique initiative type")).toBeInTheDocument();
});
diff --git a/services/ui-src/src/components/export/ExportedModalOverlayReportSection.tsx b/services/ui-src/src/components/export/ExportedModalOverlayReportSection.tsx
index 09e071fb7..1e30e3d3c 100644
--- a/services/ui-src/src/components/export/ExportedModalOverlayReportSection.tsx
+++ b/services/ui-src/src/components/export/ExportedModalOverlayReportSection.tsx
@@ -164,8 +164,9 @@ export function renderModalOverlayTableBody(
{`${idx + 1}. ${entity.initiative_name}` ?? "Not entered"}
- {entity.initiative_wp_otherTopic ??
- entity.initiative_wpTopic[0].value}
+ {entity.initiative_wp_otherTopic
+ ? entity.initiative_wp_otherTopic
+ : entity.initiative_wpTopic[0].value}
diff --git a/services/ui-src/src/utils/testing/mockReport.ts b/services/ui-src/src/utils/testing/mockReport.ts
index a75664bd0..d3130eff8 100644
--- a/services/ui-src/src/utils/testing/mockReport.ts
+++ b/services/ui-src/src/utils/testing/mockReport.ts
@@ -496,6 +496,18 @@ export const mockWPReportWithOverlays = {
},
],
},
+ {
+ ...mockWPFullReport.fieldData.entityType[0],
+ type: OverlayModalTypes.INITIATIVE,
+ id: "mock wip id",
+ initiative_wpTopic: [
+ {
+ key: "other-type-key",
+ value: "Other, specify",
+ },
+ ],
+ initiative_wp_otherTopic: "Unique initiative type",
+ },
],
},
formTemplate: {
@@ -520,27 +532,6 @@ export const mockWPReportWithOverlays = {
},
};
-export const mockWPReportWithOtherTypeOverlays = {
- ...mockWPFullReport,
- fieldData: {
- ...mockWPFullReport.fieldData,
- [OverlayModalTypes.INITIATIVE]: [
- {
- ...mockWPFullReport.fieldData.entityType[0],
- type: OverlayModalTypes.INITIATIVE,
- id: "mock wip id",
- initiative_wpTopic: [
- {
- key: "other-type-key",
- value: "Other, specify",
- },
- ],
- initiative_wp_otherTopic: "Unique initiative type",
- },
- ],
- },
-};
-
export const mockSARReportWithOverlays = {
...mockSARFullReport,
fieldData: {