Skip to content

Commit

Permalink
Add warning message to edit tasks modal. (#1091)
Browse files Browse the repository at this point in the history
  • Loading branch information
wjames111 authored Sep 27, 2024
1 parent 25bf185 commit dfc6ea2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,25 @@ describe('MassActionsEditTasksModal', () => {
});
expect(handleClose).toHaveBeenCalled();
});
it('displays warning message', async () => {
const handleClose = jest.fn();
const mutationSpy = jest.fn();
const { getByText } = render(
<LocalizationProvider dateAdapter={AdapterLuxon}>
<ThemeProvider theme={theme}>
<SnackbarProvider>
<GqlMockedProvider onCall={mutationSpy}>
<MassActionsEditTasksModal
accountListId={accountListId}
ids={['task-1', 'task-2']}
selectedIdCount={2}
handleClose={handleClose}
/>
</GqlMockedProvider>
</SnackbarProvider>
</ThemeProvider>
</LocalizationProvider>,
);
expect(getByText('Blank fields will not be affected!')).toBeInTheDocument();
});
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { ReactElement } from 'react';
import {
Alert,
Checkbox,
DialogActions,
DialogContent,
Expand Down Expand Up @@ -105,6 +106,9 @@ export const MassActionsEditTasksModal: React.FC<

return (
<Modal title={t('Edit Fields')} isOpen={true} handleClose={handleClose}>
<Alert severity="warning" style={{ justifyContent: 'center' }}>
Blank fields will not be affected!
</Alert>
<Formik<Attributes>
initialValues={{
subject: '',
Expand Down

0 comments on commit dfc6ea2

Please sign in to comment.