From 76c0bd1d4187eb471e39eaeb94ed1dbe435a76f6 Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Wed, 4 Nov 2026 09:08:09 +0100 Subject: [PATCH] test: save a subject-less draft by closing, as closing now saves without asking --- components/email/__tests__/empty-subject-warning.test.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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('');