test: save a subject-less draft by closing, as closing now saves without asking

This commit is contained in:
Linus Rath
2026-11-04 09:08:09 +01:00
parent 2b2b7b8298
commit 76c0bd1d41
@@ -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('');