Skip to content

Commit

Permalink
fix: sharing folder set 'send notification about this shared' is chec…
Browse files Browse the repository at this point in the history
…ked by default
  • Loading branch information
dhavaldodiya committed Jun 1, 2023
1 parent f1bc97f commit 645b852
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/views/sidebar/edit-permissions-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const EditPermissionsModal: FC<EditPermissionsModalProps> = ({
const [ContactInput, integrationAvailable] = useIntegratedComponent('contact-input');
const shareCalendarWithOptions = useMemo(() => ShareCalendarWithOptions(t), []);
const shareCalendarRoleOptions = useMemo(() => ShareCalendarRoleOptions(t), []);
const [sendNotification, setSendNotification] = useState(false);
const [sendNotification, setSendNotification] = useState(true);
const [standardMessage, setStandardMessage] = useState('');
const [contacts, setContacts] = useState<any>([]);
const [shareWithUserType, setshareWithUserType] = useState('usr');
Expand Down
8 changes: 4 additions & 4 deletions src/views/sidebar/tests/edit-permissions-modal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -288,22 +288,22 @@ describe('edit-permissions-modal', () => {

const sendNotificationUnCheckbox = within(
screen.getByTestId('sendNotificationCheckboxContainer')
).getByTestId('icon: Square');
).getByTestId('icon: CheckmarkSquare');

expect(sendNotificationUnCheckbox).toBeInTheDocument();

const standardMessage = screen.getByRole('textbox', {
name: /share\.standard_message/i
});
expect(standardMessage).toBeDisabled();
expect(standardMessage).toBeEnabled();

await user.click(sendNotificationUnCheckbox);
const sendNotificationCheckbox = within(
screen.getByTestId('sendNotificationCheckboxContainer')
).getByTestId('icon: CheckmarkSquare');
).getByTestId('icon: Square');
expect(sendNotificationCheckbox).toBeInTheDocument();

expect(standardMessage).toBeEnabled();
expect(standardMessage).toBeDisabled();
expect(standardMessage).toHaveValue('');
});
test.todo('when chips inside chipInput have errors, the confirm button is disabled');
Expand Down

0 comments on commit 645b852

Please sign in to comment.