Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in e7d91ef. The regression test now focuses the payload action and asserts the rendered Fluent tooltip content.

});

it('should render split button in draft mode even when canRunBeInvokedWithPayload returns false', () => {
(LogicAppsShared.canRunBeInvokedWithPayload as Mock).mockReturnValue(false);

Expand Down
9 changes: 8 additions & 1 deletion libs/designer-v2/src/lib/ui/FloatingRunButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ export const FloatingRunButton = ({
);

const [popoverOpen, setPopoverOpen] = useState(false);
const [isPayloadButtonActive, setIsPayloadButtonActive] = useState(false);

if (isA2AWorkflow) {
return (
Expand All @@ -403,7 +404,7 @@ export const FloatingRunButton = ({
if (canBeRunWithPayload) {
return (
<div className={styles.container}>
<Tooltip withArrow content={tooltipText} relationship="description">
<Tooltip withArrow content={isPayloadButtonActive ? strings.RUN_PAYLOAD_TOOLTIP : tooltipText} relationship="description">
<SplitButton
{...buttonCommonProps}
primaryActionButton={{
Expand All @@ -415,7 +416,13 @@ export const FloatingRunButton = ({
}}
menuButton={{
icon: runIsLoading && runHasPayload ? <Spinner size="tiny" /> : <RunWithPayloadIcon />,
'aria-label': strings.RUN_PAYLOAD_TOOLTIP,
title: strings.RUN_PAYLOAD_TOOLTIP,

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in e7d91ef. Removed the native title attribute and kept the Fluent tooltip plus accessible label.

onClick: () => setPopoverOpen(true),
onFocus: () => setIsPayloadButtonActive(true),
onBlur: () => setIsPayloadButtonActive(false),
onMouseEnter: () => setIsPayloadButtonActive(true),
onMouseLeave: () => setIsPayloadButtonActive(false),
ref: payloadButtonRef,
disabled: isDisabled || runIsLoading || !canBeRunWithPayload || !triggerId,
}}
Expand Down
Loading