fix(web): name variable inspect close actions (#40289)

This commit is contained in:
yyh 2026-08-10 10:56:14 +08:00 committed by GitHub
parent cc4bf22d07
commit 1b2c71ac75
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 4 deletions

View File

@ -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)

View File

@ -175,7 +175,10 @@ const Panel: FC = () => {
<div className="system-sm-semibold-uppercase text-text-primary">
{t(($) => $['debug.variableInspect.title'], { ns: 'workflow' })}
</div>
<ActionButton onClick={() => setShowVariableInspectPanel(false)}>
<ActionButton
aria-label={t(($) => $['operation.close'], { ns: 'common' })}
onClick={() => setShowVariableInspectPanel(false)}
>
<RiCloseLine className="size-4" />
</ActionButton>
</div>
@ -193,7 +196,10 @@ const Panel: FC = () => {
<div className="system-sm-semibold-uppercase text-text-primary">
{t(($) => $['debug.variableInspect.title'], { ns: 'workflow' })}
</div>
<ActionButton onClick={() => setShowVariableInspectPanel(false)}>
<ActionButton
aria-label={t(($) => $['operation.close'], { ns: 'common' })}
onClick={() => setShowVariableInspectPanel(false)}
>
<RiCloseLine className="size-4" />
</ActionButton>
</div>