diff --git a/components/email/__tests__/empty-subject-warning.test.tsx b/components/email/__tests__/empty-subject-warning.test.tsx index 26b50b734..bba41c478 100644 --- a/components/email/__tests__/empty-subject-warning.test.tsx +++ b/components/email/__tests__/empty-subject-warning.test.tsx @@ -378,9 +378,8 @@ describe('composer empty subject warning', () => { ); fireEvent.change(screen.getByDisplayValue('Lunch'), { target: { value: '' } }); + // Closing saves the draft; no question unless the save fails. act(() => requestCloseRef.current!(vi.fn())); - const dialog = await screen.findByRole('alertdialog'); - fireEvent.click(within(dialog).getByText('save')); await waitFor(() => expect(createDraft).toHaveBeenCalled()); expect(createDraft.mock.calls[0][1]).toBe('');