From b02469961b3919ca620562c9c6f22597ba40752e Mon Sep 17 00:00:00 2001 From: Greg Akins Date: Tue, 29 Oct 2024 09:17:11 -0400 Subject: [PATCH 1/4] MAT-7844: Changes to remove test case Actual values when Expected are changed; only for QDM --- src/components/editTestCase/qdm/EditTestCase.tsx | 1 + .../editTestCase/qdm/RightPanel/RightPanel.tsx | 2 ++ .../qdm/populations/GroupPopulations.test.tsx | 2 ++ .../qdm/populations/GroupPopulations.tsx | 3 +++ .../qdm/populations/TestCasePopulation.tsx | 9 ++++++--- .../populations/TestCasePopulationList.test.tsx | 16 +++++++++++----- .../qdm/populations/TestCasePopulationList.tsx | 3 +++ .../populations/TestCasePopulationListUtil.ts | 4 +++- 8 files changed, 31 insertions(+), 9 deletions(-) diff --git a/src/components/editTestCase/qdm/EditTestCase.tsx b/src/components/editTestCase/qdm/EditTestCase.tsx index b62a1b186..c50c4e6b1 100644 --- a/src/components/editTestCase/qdm/EditTestCase.tsx +++ b/src/components/editTestCase/qdm/EditTestCase.tsx @@ -322,6 +322,7 @@ const EditTestCase = () => { canEdit={canEdit} testCaseGroups={formik?.values?.groupPopulations} isTestCaseExecuted={isTestCaseExecuted} + setIsTestCaseExecuted={setIsTestCaseExecuted} errors={formik.errors.groupPopulations} groupCoverageResult={groupCoverageResult} testCaseResults={testCaseResults} diff --git a/src/components/editTestCase/qdm/RightPanel/RightPanel.tsx b/src/components/editTestCase/qdm/RightPanel/RightPanel.tsx index fc09c0b74..dceaecb6d 100644 --- a/src/components/editTestCase/qdm/RightPanel/RightPanel.tsx +++ b/src/components/editTestCase/qdm/RightPanel/RightPanel.tsx @@ -12,6 +12,7 @@ const RightPanel = ({ testCaseGroups, testCaseResults, isTestCaseExecuted, + setIsTestCaseExecuted, errors, groupCoverageResult, calculationErrors, @@ -56,6 +57,7 @@ const RightPanel = ({ onChange={onChange} errors={errors} isTestCaseExecuted={isTestCaseExecuted} + setIsTestCaseExecuted={setIsTestCaseExecuted} /> )} {activeTab === "details" && ( diff --git a/src/components/editTestCase/qdm/populations/GroupPopulations.test.tsx b/src/components/editTestCase/qdm/populations/GroupPopulations.test.tsx index 53f76ad31..a92b3b602 100644 --- a/src/components/editTestCase/qdm/populations/GroupPopulations.test.tsx +++ b/src/components/editTestCase/qdm/populations/GroupPopulations.test.tsx @@ -217,6 +217,7 @@ describe("Group Populations", () => { it("should handle checkbox changes", () => { testCaseGroups[0].scoring = MeasureScoring.CONTINUOUS_VARIABLE; const handleChange = jest.fn(); + const setIsTestCaseExecuted = jest.fn(); const updatedTestCaseGroups = [ { groupId: "Group1_ID", @@ -246,6 +247,7 @@ describe("Group Populations", () => { isTestCaseExecuted={true} testCaseResults={testCaseGroups} groupPopulations={testCaseGroups} + setIsTestCaseExecuted={setIsTestCaseExecuted} onChange={handleChange} errors={errors} /> diff --git a/src/components/editTestCase/qdm/populations/GroupPopulations.tsx b/src/components/editTestCase/qdm/populations/GroupPopulations.tsx index 50a88821e..18450293e 100644 --- a/src/components/editTestCase/qdm/populations/GroupPopulations.tsx +++ b/src/components/editTestCase/qdm/populations/GroupPopulations.tsx @@ -17,6 +17,7 @@ interface GroupPopulationsProps { disableExpected: boolean; testCaseResults: GroupPopulation[]; isTestCaseExecuted: boolean; + setIsTestCaseExecuted?: () => void; groupPopulations: GroupPopulation[]; onChange?: ( groupPopulations: GroupPopulation[], @@ -30,6 +31,7 @@ interface GroupPopulationsProps { const GroupPopulations = ({ disableExpected = false, isTestCaseExecuted = false, + setIsTestCaseExecuted, testCaseResults, groupPopulations = [], onChange, @@ -56,6 +58,7 @@ const GroupPopulations = ({ errors={errors?.[groupIndex]} disableExpected={disableExpected} isTestCaseExecuted={isTestCaseExecuted} + setIsTestCaseExecuted={setIsTestCaseExecuted} populations={gp.populationValues} populationResults={ testCaseResults diff --git a/src/components/editTestCase/qdm/populations/TestCasePopulation.tsx b/src/components/editTestCase/qdm/populations/TestCasePopulation.tsx index 4a9e402cb..318389746 100644 --- a/src/components/editTestCase/qdm/populations/TestCasePopulation.tsx +++ b/src/components/editTestCase/qdm/populations/TestCasePopulation.tsx @@ -17,6 +17,7 @@ export interface TestCasePopulationProps { i?: number; strat?: boolean; isTestCaseExecuted?: boolean; + setIsTestCaseExecuted?: (isTestCaseExecuted: boolean) => void; } const TestCasePopulation = ({ @@ -31,6 +32,7 @@ const TestCasePopulation = ({ strat, i, isTestCaseExecuted, + setIsTestCaseExecuted, }: TestCasePopulationProps) => { const populationNameTemplate = (prop) => { if (prop === PopulationType.INITIAL_POPULATION) { @@ -80,9 +82,10 @@ const TestCasePopulation = ({ aria-labelledby={`${population.name}-expected`} name={population.name} expectedValue={population.expected} - onChange={(expectedValue) => - onChange({ ...population, expected: expectedValue }) - } + onChange={(expectedValue) => { + setIsTestCaseExecuted(false); + return onChange({ ...population, expected: expectedValue }); + }} populationBasis={populationBasis} disabled={disableExpected} data-testid={ diff --git a/src/components/editTestCase/qdm/populations/TestCasePopulationList.test.tsx b/src/components/editTestCase/qdm/populations/TestCasePopulationList.test.tsx index 14b757f62..7b5eab0dd 100644 --- a/src/components/editTestCase/qdm/populations/TestCasePopulationList.test.tsx +++ b/src/components/editTestCase/qdm/populations/TestCasePopulationList.test.tsx @@ -4,6 +4,7 @@ import { MemoryRouter } from "react-router-dom"; import TestCasePopulationList from "./TestCasePopulationList"; import { MeasureScoring, PopulationType } from "@madie/madie-models"; import userEvent from "@testing-library/user-event"; +import { act } from "react-dom/test-utils"; describe("TestCasePopulationList component", () => { afterEach(() => { @@ -77,13 +78,17 @@ describe("TestCasePopulationList component", () => { actual: true, }, ]; - const handleChange = jest.fn(); + const handle1Change = jest.fn((arg1, arg2) => {}); + + const setIsTestCaseExecuted = jest.fn(); + render( { "test-population-initialPopulation-expected" ); expect(ippCb).toBeInTheDocument(); - userEvent.click(ippCb); - await waitFor(() => { - expect(handleChange).toHaveBeenCalled(); + + await act(async () => { + userEvent.click(ippCb); }); + await waitFor(() => expect(handle1Change).toHaveBeenCalled()); }); it("should handle stratification changes for the test case population", async () => { diff --git a/src/components/editTestCase/qdm/populations/TestCasePopulationList.tsx b/src/components/editTestCase/qdm/populations/TestCasePopulationList.tsx index 0dd74b63a..659fec2d5 100644 --- a/src/components/editTestCase/qdm/populations/TestCasePopulationList.tsx +++ b/src/components/editTestCase/qdm/populations/TestCasePopulationList.tsx @@ -33,6 +33,7 @@ export interface TestCasePopulationListProps { populationBasis: string; disableExpected?: boolean; isTestCaseExecuted?: boolean; + setIsTestCaseExecuted?: (isTestCaseExecuted: boolean) => void; onChange?: ( populations: DisplayPopulationValue[], changedPopulation: DisplayPopulationValue @@ -57,6 +58,7 @@ const TestCasePopulationList = ({ populationBasis, disableExpected = true, isTestCaseExecuted = false, + setIsTestCaseExecuted, onChange, onStratificationChange, errors, @@ -251,6 +253,7 @@ const TestCasePopulationList = ({ Date: Tue, 29 Oct 2024 12:38:02 -0400 Subject: [PATCH 2/4] MAT-7844: Changes to remove test case Actual values when Expected are changed; now for QiCore --- .../ExpectedActual/ExpectedActual.tsx | 6 ++++-- .../editTestCase/qiCore/EditTestCase.tsx | 5 ++++- .../populations/GroupPopulations.test.tsx | 12 +++++++---- .../populations/GroupPopulations.tsx | 12 +++++++---- .../populations/TestCasePopulation.test.tsx | 2 +- .../populations/TestCasePopulation.tsx | 15 +++++++------ .../TestCasePopulationList.test.tsx | 1 + .../populations/TestCasePopulationList.tsx | 21 ++++++++++++------- 8 files changed, 49 insertions(+), 25 deletions(-) diff --git a/src/components/createTestCase/RightPanel/ExpectedActual/ExpectedActual.tsx b/src/components/createTestCase/RightPanel/ExpectedActual/ExpectedActual.tsx index 7f9959a58..f515589e6 100644 --- a/src/components/createTestCase/RightPanel/ExpectedActual/ExpectedActual.tsx +++ b/src/components/createTestCase/RightPanel/ExpectedActual/ExpectedActual.tsx @@ -7,7 +7,8 @@ const ExpectedActual = ({ onChange, onStratificationChange, errors, - executionRun = false, + isTestCaseExecuted = false, + clearTestResults, groupsStratificationAssociationMap, }) => { return ( @@ -22,7 +23,8 @@ const ExpectedActual = ({ onChange={onChange} onStratificationChange={onStratificationChange} errors={errors} - executionRun={executionRun} + isTestCaseExecuted={isTestCaseExecuted} + setIsTestCaseExecuted={clearTestResults} /> ); diff --git a/src/components/editTestCase/qiCore/EditTestCase.tsx b/src/components/editTestCase/qiCore/EditTestCase.tsx index cb8c9fab0..e3bc6d703 100644 --- a/src/components/editTestCase/qiCore/EditTestCase.tsx +++ b/src/components/editTestCase/qiCore/EditTestCase.tsx @@ -993,7 +993,10 @@ const EditTestCase = (props: EditTestCaseProps) => { { + setPopulationGroupResults(undefined); + }} errors={formik.errors.groupPopulations} groupsStratificationAssociationMap={stratificationsMap} onChange={( diff --git a/src/components/populations/GroupPopulations.test.tsx b/src/components/populations/GroupPopulations.test.tsx index 028c25537..b6db2acec 100644 --- a/src/components/populations/GroupPopulations.test.tsx +++ b/src/components/populations/GroupPopulations.test.tsx @@ -82,7 +82,7 @@ describe("Group Populations", () => { const handleChange = jest.fn(); render( @@ -139,11 +139,13 @@ describe("Group Populations", () => { }); it("should handle null groupPopulation input", () => { + const mockExecute = jest.fn(); render( ); expect( @@ -188,7 +190,7 @@ describe("Group Populations", () => { render( { it("should handle checkbox changes", () => { testCaseGroups[0].scoring = MeasureScoring.CONTINUOUS_VARIABLE; const handleChange = jest.fn(); + const setIsTestCaseExecuted = jest.fn(); const handleStratificationChange = jest.fn(); render( void; groupPopulations: DisplayGroupPopulation[]; onChange?: ( groupPopulations: GroupPopulation[], @@ -33,7 +34,8 @@ const GroupPopulations = ({ disableExpected = false, groupsStratificationAssociationMap, // Execution run determines weather we display one of 3 views. - executionRun = false, + isTestCaseExecuted = false, + setIsTestCaseExecuted, groupPopulations = [], onChange, onStratificationChange, @@ -50,7 +52,8 @@ const GroupPopulations = ({ scoring={gp.scoring} errors={errors?.[i]} disableExpected={disableExpected} - executionRun={executionRun} + isTestCaseExecuted={isTestCaseExecuted} + setIsTestCaseExecuted={setIsTestCaseExecuted} populations={gp.populationValues} populationBasis={gp?.populationBasis} onChange={(populations, type, changedPopulation) => { @@ -81,7 +84,8 @@ const GroupPopulations = ({ } scoring={gp.scoring} disableExpected={disableExpected} - executionRun={executionRun} + isTestCaseExecuted={isTestCaseExecuted} + setIsTestCaseExecuted={setIsTestCaseExecuted} populations={null} populationBasis={gp.populationBasis} onStratificationChange={( diff --git a/src/components/populations/TestCasePopulation.test.tsx b/src/components/populations/TestCasePopulation.test.tsx index 278d86d52..9b1bc7d2b 100644 --- a/src/components/populations/TestCasePopulation.test.tsx +++ b/src/components/populations/TestCasePopulation.test.tsx @@ -22,7 +22,7 @@ describe("TestCasePopulation component", () => { void; population: DisplayPopulationValue; populationBasis: string; showExpected?: boolean; @@ -17,7 +18,8 @@ export interface TestCasePopulationProps { } const TestCasePopulation = ({ - executionRun, + isTestCaseExecuted, + setIsTestCaseExecuted, population, populationBasis, disableExpected = false, @@ -70,9 +72,10 @@ const TestCasePopulation = ({ aria-labelledby={`${population.name}-expected`} name={population.name} expectedValue={population.expected} - onChange={(expectedValue) => - onChange({ ...population, expected: expectedValue }) - } + onChange={(expectedValue) => { + setIsTestCaseExecuted(false); + onChange({ ...population, expected: expectedValue }); + }} populationBasis={populationBasis} disabled={disableExpected} data-testid={`test-population-${population.name}-expected`} @@ -80,7 +83,7 @@ const TestCasePopulation = ({ />
- {executionRun ? ( + {isTestCaseExecuted ? ( { void; onChange?: ( populations: DisplayPopulationValue[], type: "actual" | "expected", @@ -112,7 +113,8 @@ const TestCasePopulationList = ({ stratifications, populationBasis, disableExpected = true, - executionRun = false, + isTestCaseExecuted = false, + setIsTestCaseExecuted, onChange, onStratificationChange, errors, @@ -216,11 +218,15 @@ const TestCasePopulationList = ({ }; // we need to do an all check here for pass / no pass - const view = determineGroupResult(populationBasis, populations, executionRun); + const view = determineGroupResult( + populationBasis, + populations, + isTestCaseExecuted + ); const viewStratification = determineGroupResultStratification( populationBasis, stratifications, - executionRun, + isTestCaseExecuted, groupsStratificationAssociationMap ); @@ -244,7 +250,7 @@ const TestCasePopulationList = ({ className="population-table" >
- {executionRun && ( + {isTestCaseExecuted && ( {populations?.map((population, j) => ( Date: Wed, 30 Oct 2024 09:50:07 -0400 Subject: [PATCH 3/4] Update src/components/editTestCase/qdm/populations/GroupPopulations.tsx Co-authored-by: Ashok Dongare --- .../editTestCase/qdm/populations/GroupPopulations.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/editTestCase/qdm/populations/GroupPopulations.tsx b/src/components/editTestCase/qdm/populations/GroupPopulations.tsx index 18450293e..dddc9b3ff 100644 --- a/src/components/editTestCase/qdm/populations/GroupPopulations.tsx +++ b/src/components/editTestCase/qdm/populations/GroupPopulations.tsx @@ -17,7 +17,7 @@ interface GroupPopulationsProps { disableExpected: boolean; testCaseResults: GroupPopulation[]; isTestCaseExecuted: boolean; - setIsTestCaseExecuted?: () => void; + setIsTestCaseExecuted?: (isTestCaseExecuted: boolean) => void; groupPopulations: GroupPopulation[]; onChange?: ( groupPopulations: GroupPopulation[], From 19943029696d94e66fd6287ebe08be5b091f99c8 Mon Sep 17 00:00:00 2001 From: Greg Akins Date: Wed, 30 Oct 2024 16:02:25 -0400 Subject: [PATCH 4/4] MAT-7844: Fixed issues with Stratification --- src/api/CalculationService.ts | 2 +- .../qdm/populations/GroupPopulations.tsx | 1 + .../populations/TestCasePopulationList.test.tsx | 4 ++++ .../qdm/populations/TestCasePopulationList.tsx | 1 + .../TestCaseStratification.test.tsx | 4 +++- .../stratifications/TestCaseStratification.tsx | 9 ++++++--- .../populations/TestCasePopulationList.test.tsx | 7 +++++-- .../populations/TestCasePopulationList.tsx | 3 ++- .../stratifications/TestCaseStratification.tsx | 9 ++++++--- .../TestCaseStratificationRow.tsx | 16 ++++++++++------ 10 files changed, 39 insertions(+), 17 deletions(-) diff --git a/src/api/CalculationService.ts b/src/api/CalculationService.ts index 4b451ee05..6a0e98a39 100644 --- a/src/api/CalculationService.ts +++ b/src/api/CalculationService.ts @@ -434,7 +434,7 @@ export class CalculationService { strata.strataCode === strataResult.strataCode) || (strata.strataId && strata.strataId === strataResult.strataId) ); - return population.result && stratification.result; + return population?.result && stratification?.result; } ); // adjust the episode count for strata & associated population diff --git a/src/components/editTestCase/qdm/populations/GroupPopulations.tsx b/src/components/editTestCase/qdm/populations/GroupPopulations.tsx index dddc9b3ff..2b190a6d5 100644 --- a/src/components/editTestCase/qdm/populations/GroupPopulations.tsx +++ b/src/components/editTestCase/qdm/populations/GroupPopulations.tsx @@ -99,6 +99,7 @@ const GroupPopulations = ({ scoring={gp.scoring} disableExpected={disableExpected} isTestCaseExecuted={isTestCaseExecuted} + setIsTestCaseExecuted={setIsTestCaseExecuted} populations={strat.populationValues} populationResults={ testCaseResults diff --git a/src/components/editTestCase/qdm/populations/TestCasePopulationList.test.tsx b/src/components/editTestCase/qdm/populations/TestCasePopulationList.test.tsx index 7b5eab0dd..26bd2c4ca 100644 --- a/src/components/editTestCase/qdm/populations/TestCasePopulationList.test.tsx +++ b/src/components/editTestCase/qdm/populations/TestCasePopulationList.test.tsx @@ -132,6 +132,7 @@ describe("TestCasePopulationList component", () => { }; const handleChange = jest.fn(); const handleStratificationChange = jest.fn(); + const setIsTestCaseExecuted = jest.fn(); render( @@ -147,6 +148,7 @@ describe("TestCasePopulationList component", () => { content="population" groupIndex={0} scoring="Proportion" + setIsTestCaseExecuted={setIsTestCaseExecuted} /> ); @@ -183,6 +185,7 @@ describe("TestCasePopulationList component", () => { }; const handleChange = jest.fn(); const handleStratificationChange = jest.fn(); + const setIsTestCaseExecuted = jest.fn(); render( @@ -199,6 +202,7 @@ describe("TestCasePopulationList component", () => { groupIndex={0} scoring="Proportion" isTestCaseExecuted={true} + setIsTestCaseExecuted={setIsTestCaseExecuted} /> ); diff --git a/src/components/editTestCase/qdm/populations/TestCasePopulationList.tsx b/src/components/editTestCase/qdm/populations/TestCasePopulationList.tsx index 659fec2d5..a23bf5a99 100644 --- a/src/components/editTestCase/qdm/populations/TestCasePopulationList.tsx +++ b/src/components/editTestCase/qdm/populations/TestCasePopulationList.tsx @@ -238,6 +238,7 @@ const TestCasePopulationList = ({ index={groupIndex} QDM={true} isTestCaseExecuted={isTestCaseExecuted} + setIsTestCaseExecuted={setIsTestCaseExecuted} strataCode={stratification?.name} stratification={stratification} stratResult={stratResult} diff --git a/src/components/editTestCase/qdm/stratifications/TestCaseStratification.test.tsx b/src/components/editTestCase/qdm/stratifications/TestCaseStratification.test.tsx index 495199e45..08f9ad6da 100644 --- a/src/components/editTestCase/qdm/stratifications/TestCaseStratification.test.tsx +++ b/src/components/editTestCase/qdm/stratifications/TestCaseStratification.test.tsx @@ -10,6 +10,7 @@ import userEvent from "@testing-library/user-event"; import TestCaseStratification from "./TestCaseStratification"; describe("Test Case Stratification Component", () => { + const setIsTestCaseExecuted = jest.fn(); const { findByTestId, findByText, getByTestId } = screen; const renderStrats = ( strataCode, @@ -24,7 +25,8 @@ describe("Test Case Stratification Component", () => { render( void; } const TestCaseStratification = ({ @@ -23,6 +24,7 @@ const TestCaseStratification = ({ populationBasis, disableExpected = false, onStratificationChange, + setIsTestCaseExecuted, index, QDM = false, isTestCaseExecuted = false, @@ -41,12 +43,13 @@ const TestCaseStratification = ({ + onChange={(expectedValue) => { + setIsTestCaseExecuted(false); onStratificationChange({ ...stratification, expected: expectedValue, - }) - } + }); + }} populationBasis={populationBasis} disabled={disableExpected} data-testid={ diff --git a/src/components/populations/TestCasePopulationList.test.tsx b/src/components/populations/TestCasePopulationList.test.tsx index 86cd40f7b..a35f2796e 100644 --- a/src/components/populations/TestCasePopulationList.test.tsx +++ b/src/components/populations/TestCasePopulationList.test.tsx @@ -140,12 +140,13 @@ describe("TestCasePopulationList component", () => { }; const handleChange = jest.fn(); const handleStratificationChange = jest.fn(); - + const setIsTestCaseExecuted = jest.fn(); render( { const groupStratificationsMap = { "1": [PopulationType.INITIAL_POPULATION], }; + const setIsTestCaseExecuted = jest.fn(); render( { content="population" i={0} scoring="Proportion" - executionRun={true} + isTestCaseExecuted={true} + setIsTestCaseExecuted={setIsTestCaseExecuted} /> ); diff --git a/src/components/populations/TestCasePopulationList.tsx b/src/components/populations/TestCasePopulationList.tsx index c3adf7427..8672c80ae 100644 --- a/src/components/populations/TestCasePopulationList.tsx +++ b/src/components/populations/TestCasePopulationList.tsx @@ -302,7 +302,8 @@ const TestCasePopulationList = ({ groupsStratificationAssociationMap } strataCode={stratification.name} - executionRun={isTestCaseExecuted} + isTestCaseExecuted={isTestCaseExecuted} + setIsTestCaseExecuted={setIsTestCaseExecuted} stratification={stratification} populationBasis={populationBasis} key={stratification.id} diff --git a/src/components/stratifications/TestCaseStratification.tsx b/src/components/stratifications/TestCaseStratification.tsx index 140f6d3b4..d6297608e 100644 --- a/src/components/stratifications/TestCaseStratification.tsx +++ b/src/components/stratifications/TestCaseStratification.tsx @@ -5,7 +5,8 @@ import TestCaseStratificationRow from "./TestCaseStratificationRow"; export interface TestCaseStratificationProps { strataCode: string; - executionRun: boolean; + isTestCaseExecuted?: boolean; + setIsTestCaseExecuted?: (isTestCaseExecuted: boolean) => void; stratification: DisplayStratificationValue; populationBasis: string; showExpected?: boolean; @@ -19,7 +20,8 @@ export interface TestCaseStratificationProps { const TestCaseStratification = ({ strataCode, - executionRun, + isTestCaseExecuted, + setIsTestCaseExecuted, stratification, populationBasis, disableExpected = false, @@ -40,7 +42,8 @@ const TestCaseStratification = ({ stratification={strat} //actuall a population value stratId={stratification.id} strataCode={strataCode} - executionRun={executionRun} + isTestCaseExecuted={isTestCaseExecuted} + setIsTestCaseExecuted={setIsTestCaseExecuted} populationBasis={populationBasis} disableExpected={disableExpected} onStratificationChange={onStratificationChange} diff --git a/src/components/stratifications/TestCaseStratificationRow.tsx b/src/components/stratifications/TestCaseStratificationRow.tsx index f8719b2c9..c349dc73a 100644 --- a/src/components/stratifications/TestCaseStratificationRow.tsx +++ b/src/components/stratifications/TestCaseStratificationRow.tsx @@ -6,7 +6,8 @@ import ExpectActualInput from "../populations/ExpectActualInput"; export interface TestCaseStratificationRowProps { strataCode: string; - executionRun: boolean; + isTestCaseExecuted: boolean; + setIsTestCaseExecuted: (isTestCaseExecuted: boolean) => void; stratification: DisplayStratificationValue; populationBasis: string; showExpected?: boolean; @@ -21,7 +22,8 @@ export interface TestCaseStratificationRowProps { const TestCaseStratificationRow = ({ strataCode, - executionRun, + isTestCaseExecuted, + setIsTestCaseExecuted, stratification, populationBasis, disableExpected = false, @@ -44,6 +46,7 @@ const TestCaseStratificationRow = ({ expectedValue={stratification.expected} disabled={disableExpected} onChange={(expectedValue) => { + setIsTestCaseExecuted(false); onStratificationChange( { ...stratification, @@ -58,19 +61,20 @@ const TestCaseStratificationRow = ({ />
- {executionRun ? ( + {isTestCaseExecuted ? ( + onChange={(expectedValue) => { + setIsTestCaseExecuted(false); onStratificationChange( { ...stratification, actual: expectedValue, }, stratId - ) - } + ); + }} populationBasis={populationBasis} disabled={true} data-testid={`${strataCode}-${stratification.name}-actual`}