Type DELETE to confirm.
} confirmText='Delete' destructive /> ) const deleteBtn = getByRole('button', { name: 'Delete' }) await expect.element(deleteBtn).toHaveAttribute('type', 'submit') await expect .element(deleteBtn) .toHaveAttribute('form', 'tasks-multi-delete-form') }) it('submits the desc form when confirm is clicked (form prop, no handleConfirm)', async () => { const handleFormSubmit = vi.fn((e: SubmitEventConfirm deletion.
} confirmText='Delete' destructive /> ) await userEvent.click(getByRole('button', { name: 'Delete' })) expect(handleFormSubmit).toHaveBeenCalledOnce() }) it('submits the form when Enter key is pressed', async () => { const handleFormSubmit = vi.fn((e: SubmitEventEnter username to enable Delete.
} confirmText='Delete' destructive /> ) const deleteBtn = getByRole('button', { name: 'Delete' }) await expect.element(deleteBtn).toBeDisabled() expect(handleFormSubmit).not.toHaveBeenCalled() }) })