Skip to content

Commit

Permalink
Add analysis_applicable to mock
Browse files Browse the repository at this point in the history
  • Loading branch information
bangbay-bluetiger committed Jan 30, 2025
1 parent 9f8a3fe commit 4db9b88
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
9 changes: 9 additions & 0 deletions services/ui-src/src/components/fields/DynamicField.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,15 @@ describe("<DynamicField />", () => {
},
],
},
{
...DEFAULT_ANALYSIS_METHODS[1],
analysis_applicable: [
{
id: "mock-analysis-applicable",
value: "Yes",
},
],
},
{
id: "custom_entity",
name: "custom entity",
Expand Down
9 changes: 3 additions & 6 deletions services/ui-src/src/components/reports/DrawerReportPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -260,13 +260,10 @@ export const DrawerReportPage = ({ route, validateOnRender }: Props) => {
// logic to ensure analysis methods always have a plan selected
if (
isAnalysisMethodsPage &&
!entity?.analysis_method_applicable_plans?.length
!entity?.analysis_method_applicable_plans?.length &&
(isCustomEntity || entity?.analysis_applicable?.[0]?.value === "Yes")
) {
if (isCustomEntity) {
return false;
} else if (entity?.analysis_applicable?.[0]?.value === "Yes") {
return false;
}
return false;
}

let formFields = form.fields;
Expand Down
9 changes: 9 additions & 0 deletions services/ui-src/src/utils/testing/mockReport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,15 @@ export const mockNaaarReportWithAnalysisMethods = {
},
],
},
{
...DEFAULT_ANALYSIS_METHODS[1],
analysis_applicable: [
{
id: "mock-analysis-applicable",
value: "Yes",
},
],
},
{
id: "custom_entity",
name: "custom entity",
Expand Down

0 comments on commit 4db9b88

Please sign in to comment.