From 2a66b49bc7c1ace1d5e70e4cbfe8b606428b8324 Mon Sep 17 00:00:00 2001 From: yyh <92089059+lyzno1@users.noreply.github.com> Date: Mon, 10 Aug 2026 10:56:14 +0800 Subject: [PATCH] fix(web): name human input delete action (#40293) --- .../human-input/components/__tests__/user-action.spec.tsx | 4 ++-- .../workflow/nodes/human-input/components/user-action.tsx | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/web/app/components/workflow/nodes/human-input/components/__tests__/user-action.spec.tsx b/web/app/components/workflow/nodes/human-input/components/__tests__/user-action.spec.tsx index f6c07d2c778..bc83181ee8b 100644 --- a/web/app/components/workflow/nodes/human-input/components/__tests__/user-action.spec.tsx +++ b/web/app/components/workflow/nodes/human-input/components/__tests__/user-action.spec.tsx @@ -122,7 +122,7 @@ describe('UserActionItem', () => { target: { value: ' ' }, }) fireEvent.click(screen.getByText('change-style')) - fireEvent.click(screen.getAllByRole('button')[1]!) + fireEvent.click(screen.getByRole('button', { name: 'operation.delete' })) expect(onChange).toHaveBeenNthCalledWith(1, expect.objectContaining({ id: '' })) expect(onChange).toHaveBeenNthCalledWith( @@ -135,6 +135,6 @@ describe('UserActionItem', () => { expect(screen.getByTestId('nodes.humanInput.userActions.actionNamePlaceholder'))!.toBeDisabled() expect(screen.getByTestId('nodes.humanInput.userActions.buttonTextPlaceholder'))!.toBeDisabled() - expect(screen.getAllByRole('button')).toHaveLength(1) + expect(screen.queryByRole('button', { name: 'operation.delete' })).not.toBeInTheDocument() }) }) diff --git a/web/app/components/workflow/nodes/human-input/components/user-action.tsx b/web/app/components/workflow/nodes/human-input/components/user-action.tsx index 5e76e9e9152..0a2705729de 100644 --- a/web/app/components/workflow/nodes/human-input/components/user-action.tsx +++ b/web/app/components/workflow/nodes/human-input/components/user-action.tsx @@ -101,7 +101,12 @@ const UserActionItem: FC = ({ data, onChange, onDelete, rea readonly={readonly} /> {!readonly && ( - )}