Skip to content

Commit

Permalink
ADM-902: [frontend] fix: fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
neomgb committed Apr 16, 2024
1 parent a19e5ae commit deccf87
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ export const DeploymentFrequencySettings = () => {
};

const totalPipelineNumber = realDeploymentFrequencySettings.length;
const shouldShowCrews =
loadingCompletedNumber !== 0 && totalPipelineNumber !== 0 && loadingCompletedNumber === totalPipelineNumber;

return (
<>
Expand Down Expand Up @@ -73,16 +75,14 @@ export const DeploymentFrequencySettings = () => {
/>
))}
<AddButton onClick={handleAddPipeline} text={'New Pipeline'} />
{loadingCompletedNumber !== 0 &&
totalPipelineNumber !== 0 &&
loadingCompletedNumber === totalPipelineNumber && (
<Crews
options={pipelineCrews}
title={'Crew setting (optional)'}
label={'Included Crews'}
type={'pipeline'}
/>
)}
{shouldShowCrews && (
<Crews
options={pipelineCrews}
title={'Crew setting (optional)'}
label={'Included Crews'}
type={'pipeline'}
/>
)}
</>
)}
</>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/context/Metrics/metricsSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ export const metricsSlice = createSlice({
: '';
return {
id,
isStepSelected: isStepSelected ? isStepSelected : false,
isStepSelected: isStepSelected || false,
organization: matchedOrganization,
pipelineName: matchedPipelineName,
step: matchedPipelineName ? step : '',
Expand Down Expand Up @@ -597,7 +597,7 @@ export const metricsSlice = createSlice({
return pipeline?.id === id
? {
...pipeline,
step: stepWarningMessage(selectedPipelineStep, matchedPipeline.isStepSelected),
step: stepWarningMessage(selectedPipelineStep, matchedPipeline?.isStepSelected || false),
}
: pipeline;
});
Expand Down

0 comments on commit deccf87

Please sign in to comment.