Skip to content

Commit

Permalink
ADM-839[frontend]fix next button when no jira card (#1131)
Browse files Browse the repository at this point in the history
  • Loading branch information
pfpatrick authored Mar 11, 2024
1 parent b398b9c commit 864db42
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
initDeploymentFrequencySettings,
saveUsers,
updateShouldGetBoardConfig,
updateShouldGetPipelineConfig,
} from '@src/context/Metrics/metricsSlice';
Expand All @@ -22,6 +23,7 @@ jest.mock('@src/context/Metrics/metricsSlice', () => ({
updateShouldGetBoardConfig: jest.fn().mockReturnValue({ type: 'SHOULD_UPDATE_BOARD_CONFIG' }),
updateShouldGetPipelineConfig: jest.fn().mockReturnValue({ type: 'SHOULD_UPDATE_PIPELINE_CONFIG' }),
initDeploymentFrequencySettings: jest.fn().mockReturnValue({ type: 'INIT_DEPLOYMENT_SETTINGS' }),
saveUsers: jest.fn().mockReturnValue({ type: 'SAVE_USERS' }),
}));

const setup = () => {
Expand Down Expand Up @@ -94,6 +96,7 @@ describe('DateRangePicker', () => {
expect(updateShouldGetBoardConfig).toHaveBeenCalledWith(true);
expect(updateShouldGetPipelineConfig).toHaveBeenCalledWith(true);
expect(initDeploymentFrequencySettings).toHaveBeenCalled();
expect(saveUsers).toHaveBeenCalledWith([]);
});

it('should dispatch update configuration when change endDate', () => {
Expand All @@ -103,5 +106,6 @@ describe('DateRangePicker', () => {
expect(updateShouldGetBoardConfig).toHaveBeenCalledWith(true);
expect(updateShouldGetPipelineConfig).toHaveBeenCalledWith(true);
expect(initDeploymentFrequencySettings).toHaveBeenCalled();
expect(saveUsers).toHaveBeenCalledWith([]);
});
});
2 changes: 2 additions & 0 deletions frontend/src/containers/ConfigStep/DateRangePicker/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
initDeploymentFrequencySettings,
saveUsers,
updateShouldGetBoardConfig,
updateShouldGetPipelineConfig,
} from '@src/context/Metrics/metricsSlice';
Expand All @@ -21,6 +22,7 @@ export const DateRangePicker = () => {
dispatch(updateShouldGetBoardConfig(true));
dispatch(updateShouldGetPipelineConfig(true));
dispatch(initDeploymentFrequencySettings());
dispatch(saveUsers([]));
};
const changeStartDate = (value: Nullable<Dayjs>) => {
dispatch(
Expand Down

0 comments on commit 864db42

Please sign in to comment.