From 224e07a927cf3a132a0e03857f3ac5b73985a362 Mon Sep 17 00:00:00 2001 From: Mia Miu Date: Sun, 23 Aug 2026 19:08:13 +1200 Subject: [PATCH 1/2] fix: distinguish run with payload tooltip --- .../__tests__/floatingRunButton.spec.tsx | 9 +++++++++ libs/designer-v2/src/lib/ui/FloatingRunButton/index.tsx | 9 ++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/libs/designer-v2/src/lib/ui/FloatingRunButton/__tests__/floatingRunButton.spec.tsx b/libs/designer-v2/src/lib/ui/FloatingRunButton/__tests__/floatingRunButton.spec.tsx index 16afe18edf0..cb76b212f43 100644 --- a/libs/designer-v2/src/lib/ui/FloatingRunButton/__tests__/floatingRunButton.spec.tsx +++ b/libs/designer-v2/src/lib/ui/FloatingRunButton/__tests__/floatingRunButton.spec.tsx @@ -324,6 +324,15 @@ describe('FloatingRunButton', () => { expect(buttons.length).toBeGreaterThan(1); }); + it('should identify the payload action with a distinct tooltip', () => { + (LogicAppsShared.canRunBeInvokedWithPayload as Mock).mockReturnValue(true); + + renderWithProviders(defaultProps); + + const payloadButton = screen.getByRole('button', { name: 'Run with payload' }); + expect(payloadButton).toHaveAttribute('title', 'Run with payload'); + }); + it('should render split button in draft mode even when canRunBeInvokedWithPayload returns false', () => { (LogicAppsShared.canRunBeInvokedWithPayload as Mock).mockReturnValue(false); diff --git a/libs/designer-v2/src/lib/ui/FloatingRunButton/index.tsx b/libs/designer-v2/src/lib/ui/FloatingRunButton/index.tsx index ad2dc7bf2de..aefe6eda2e6 100644 --- a/libs/designer-v2/src/lib/ui/FloatingRunButton/index.tsx +++ b/libs/designer-v2/src/lib/ui/FloatingRunButton/index.tsx @@ -382,6 +382,7 @@ export const FloatingRunButton = ({ ); const [popoverOpen, setPopoverOpen] = useState(false); + const [isPayloadButtonActive, setIsPayloadButtonActive] = useState(false); if (isA2AWorkflow) { return ( @@ -403,7 +404,7 @@ export const FloatingRunButton = ({ if (canBeRunWithPayload) { return (
- + : , + 'aria-label': strings.RUN_PAYLOAD_TOOLTIP, + title: strings.RUN_PAYLOAD_TOOLTIP, onClick: () => setPopoverOpen(true), + onFocus: () => setIsPayloadButtonActive(true), + onBlur: () => setIsPayloadButtonActive(false), + onMouseEnter: () => setIsPayloadButtonActive(true), + onMouseLeave: () => setIsPayloadButtonActive(false), ref: payloadButtonRef, disabled: isDisabled || runIsLoading || !canBeRunWithPayload || !triggerId, }} From e7d91ef82dc2d241991efa61bde79c1ef169884d Mon Sep 17 00:00:00 2001 From: Mia Miu Date: Sun, 23 Aug 2026 19:16:18 +1200 Subject: [PATCH 2/2] test: exercise payload tooltip behavior --- .../__tests__/floatingRunButton.spec.tsx | 8 +++++--- libs/designer-v2/src/lib/ui/FloatingRunButton/index.tsx | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libs/designer-v2/src/lib/ui/FloatingRunButton/__tests__/floatingRunButton.spec.tsx b/libs/designer-v2/src/lib/ui/FloatingRunButton/__tests__/floatingRunButton.spec.tsx index cb76b212f43..7eeadb572d8 100644 --- a/libs/designer-v2/src/lib/ui/FloatingRunButton/__tests__/floatingRunButton.spec.tsx +++ b/libs/designer-v2/src/lib/ui/FloatingRunButton/__tests__/floatingRunButton.spec.tsx @@ -4,7 +4,7 @@ import '@testing-library/jest-dom/vitest'; import type { ComponentProps } from 'react'; import { describe, it, expect, beforeEach, afterEach, vi, type Mock } from 'vitest'; -import { render, screen, cleanup } from '@testing-library/react'; +import { render, screen, cleanup, fireEvent } from '@testing-library/react'; import { IntlProvider } from 'react-intl'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { Provider } from 'react-redux'; @@ -324,13 +324,15 @@ describe('FloatingRunButton', () => { expect(buttons.length).toBeGreaterThan(1); }); - it('should identify the payload action with a distinct tooltip', () => { + it('should identify the payload action with a distinct tooltip', async () => { (LogicAppsShared.canRunBeInvokedWithPayload as Mock).mockReturnValue(true); renderWithProviders(defaultProps); const payloadButton = screen.getByRole('button', { name: 'Run with payload' }); - expect(payloadButton).toHaveAttribute('title', 'Run with payload'); + fireEvent.focus(payloadButton); + + expect(await screen.findByRole('tooltip')).toHaveTextContent('Run with payload'); }); it('should render split button in draft mode even when canRunBeInvokedWithPayload returns false', () => { diff --git a/libs/designer-v2/src/lib/ui/FloatingRunButton/index.tsx b/libs/designer-v2/src/lib/ui/FloatingRunButton/index.tsx index aefe6eda2e6..5d6507ce1e9 100644 --- a/libs/designer-v2/src/lib/ui/FloatingRunButton/index.tsx +++ b/libs/designer-v2/src/lib/ui/FloatingRunButton/index.tsx @@ -417,7 +417,6 @@ export const FloatingRunButton = ({ menuButton={{ icon: runIsLoading && runHasPayload ? : , 'aria-label': strings.RUN_PAYLOAD_TOOLTIP, - title: strings.RUN_PAYLOAD_TOOLTIP, onClick: () => setPopoverOpen(true), onFocus: () => setIsPayloadButtonActive(true), onBlur: () => setIsPayloadButtonActive(false),