From 1b2c71ac758a23a72f0087fd3ca3b4139a6e4e99 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 variable inspect close actions (#40289) --- .../workflow/variable-inspect/__tests__/panel.spec.tsx | 8 ++++++-- web/app/components/workflow/variable-inspect/panel.tsx | 10 ++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/web/app/components/workflow/variable-inspect/__tests__/panel.spec.tsx b/web/app/components/workflow/variable-inspect/__tests__/panel.spec.tsx index 47c1d29e915..455eae353ae 100644 --- a/web/app/components/workflow/variable-inspect/__tests__/panel.spec.tsx +++ b/web/app/components/workflow/variable-inspect/__tests__/panel.spec.tsx @@ -131,9 +131,10 @@ describe('VariableInspect Panel', () => { }) it('should render the listening state and stop the workflow on demand', () => { - renderPanel({ + const { store } = renderPanel({ isListening: true, listeningTriggerType: BlockEnum.TriggerWebhook, + showVariableInspectPanel: true, }) fireEvent.click( @@ -144,6 +145,9 @@ describe('VariableInspect Panel', () => { expect(mockEmit).toHaveBeenCalledWith({ type: EVENT_WORKFLOW_STOP, }) + + fireEvent.click(screen.getByRole('button', { name: 'common.operation.close' })) + expect(store.getState().showVariableInspectPanel).toBe(false) }) it('should render the empty state and close the panel from the header action', () => { @@ -151,7 +155,7 @@ describe('VariableInspect Panel', () => { showVariableInspectPanel: true, }) - fireEvent.click(screen.getAllByRole('button')[0]!) + fireEvent.click(screen.getByRole('button', { name: 'common.operation.close' })) expect(screen.getByText('workflow.debug.variableInspect.emptyTip'))!.toBeInTheDocument() expect(store.getState().showVariableInspectPanel).toBe(false) diff --git a/web/app/components/workflow/variable-inspect/panel.tsx b/web/app/components/workflow/variable-inspect/panel.tsx index f0d2e6779c8..c31ef83911a 100644 --- a/web/app/components/workflow/variable-inspect/panel.tsx +++ b/web/app/components/workflow/variable-inspect/panel.tsx @@ -175,7 +175,10 @@ const Panel: FC = () => {