Skip to content

Commit

Permalink
Fix bad merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Zacqary committed Oct 25, 2023
1 parent 8761805 commit b16baec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,9 @@ describe('rules_settings_modal', () => {
test('reset flapping settings to initial state on cancel without triggering another server reload', async () => {
const result = render(<RulesSettingsModalWithProviders {...modalProps} />);
expect(getFlappingSettingsMock).toHaveBeenCalledTimes(1);
expect(getQueryDelaySettingsMock).toHaveBeenCalledTimes(1);
await waitForModalLoad();
await waitFor(() => {
expect(result.queryByTestId('centerJustifiedSpinner')).toBe(null);
});

const lookBackWindowInput = result.getByTestId('lookBackWindowRangeInput');
const statusChangeThresholdInput = result.getByTestId('statusChangeThresholdRangeInput');
Expand All @@ -181,12 +182,11 @@ describe('rules_settings_modal', () => {
expect(updateFlappingSettingsMock).not.toHaveBeenCalled();
expect(modalProps.onSave).not.toHaveBeenCalled();

expect(screen.queryByTestId('centerJustifiedSpinner')).toBe(null);
expect(result.queryByTestId('centerJustifiedSpinner')).toBe(null);
expect(lookBackWindowInput.getAttribute('value')).toBe('10');
expect(statusChangeThresholdInput.getAttribute('value')).toBe('10');

expect(getFlappingSettingsMock).toHaveBeenCalledTimes(1);
expect(getQueryDelaySettingsMock).toHaveBeenCalledTimes(1);
});

test('should prevent statusChangeThreshold from being greater than lookBackWindow', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export const RulesSettingsModal = memo((props: RulesSettingsModalProps) => {

const handleSave = () => {
if (canWriteFlappingSettings && hasFlappingChanged) {
mutate(flappingSettings);
mutate(flappingSettings!);
setFlappingSettings(flappingSettings!, true);
}
};
Expand Down

0 comments on commit b16baec

Please sign in to comment.