Skip to content

Commit 51ff418

Browse files
authored
Updated automations email modal to stay open on save (#28481)
no ref #28438 was meant to make it so the automations email editor would stay open after you saved changes, but there was still a `closeEmailModal()` in the `onSave` handler. This fixes that!
1 parent 484ce51 commit 51ff418

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

apps/posts/src/views/Automations/components/canvas/automation-canvas.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,6 @@ const AutomationCanvas: React.FC<AutomationCanvasProps> = ({actionErrors = {}, a
498498
onClose={closeEmailModal}
499499
onSave={({subject, lexical}) => {
500500
onChange(updateSendEmailAction({detail: automation, actionId: emailModalAction.id, emailSubject: subject, emailLexical: lexical}));
501-
closeEmailModal();
502501
}}
503502
/>
504503
)}

apps/posts/test/unit/views/automations/automation-editor.test.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -693,8 +693,9 @@ describe('AutomationEditor', () => {
693693
expect(mockEditMutation.mutate).not.toHaveBeenCalled();
694694
fireEvent.click(screen.getByTestId('modal-save'));
695695
expect(mockEditMutation.mutate).not.toHaveBeenCalled();
696-
// The modal closes after saving.
697-
expect(screen.queryByTestId('email-content-modal')).not.toBeInTheDocument();
696+
// The modal stays open after saving; Close is the only way out.
697+
expect(screen.getByTestId('email-content-modal')).toBeInTheDocument();
698+
fireEvent.click(screen.getByTestId('modal-close'));
698699

699700
// Publishing persists the edited content.
700701
fireEvent.click(screen.getByRole('button', {name: 'Publish changes'}));

0 commit comments

Comments
 (0)