diff --git a/packages/frontend/editor-ui/src/features/agents/__tests__/AgentEvalTryRow.test.ts b/packages/frontend/editor-ui/src/features/agents/__tests__/AgentEvalTryRow.test.ts index 871295daa60..898753cd978 100644 --- a/packages/frontend/editor-ui/src/features/agents/__tests__/AgentEvalTryRow.test.ts +++ b/packages/frontend/editor-ui/src/features/agents/__tests__/AgentEvalTryRow.test.ts @@ -435,6 +435,36 @@ describe('AgentEvalTryRow', () => { expect(getByTestId('row-delete-check')).toBeDisabled(); }); + + it.each([ + ['a passing case, after "Run check"', 'pass', 'row-run-check'], + ['a case that needs work, after "Actually fine"', 'work', 'row-actually-fine'], + ] as const)( + 'puts delete at the end of the actions for %s', + async (_label, status, lastAction) => { + const user = userEvent.setup(); + const { getByTestId } = renderWithRule({ testId: 'row', status, output: 'y' }); + await user.click(getByTestId('row-toggle')); + + const action = getByTestId(lastAction); + const deleteButton = getByTestId('row-delete-check'); + expect(action.compareDocumentPosition(deleteButton)).toBe(Node.DOCUMENT_POSITION_FOLLOWING); + expect(getByTestId('row-edit-rule').compareDocumentPosition(action)).toBe( + Node.DOCUMENT_POSITION_FOLLOWING, + ); + }, + ); + + it('keeps delete available while the rule is being edited', async () => { + const user = userEvent.setup(); + const { getByTestId, queryByTestId } = renderWithRule({ testId: 'row' }); + await user.click(getByTestId('row-toggle')); + + await user.click(getByTestId('row-edit-rule')); + + expect(queryByTestId('row-edit-rule')).not.toBeInTheDocument(); + expect(getByTestId('row-delete-check')).toBeEnabled(); + }); }); describe('practice run banner', () => { diff --git a/packages/frontend/editor-ui/src/features/agents/components/AgentEvalTryRow.vue b/packages/frontend/editor-ui/src/features/agents/components/AgentEvalTryRow.vue index 6022f452a2b..bd948492173 100644 --- a/packages/frontend/editor-ui/src/features/agents/components/AgentEvalTryRow.vue +++ b/packages/frontend/editor-ui/src/features/agents/components/AgentEvalTryRow.vue @@ -16,6 +16,7 @@ import { N8nInput, N8nText, N8nTimeAgo, + N8nTooltip, type TextColor, } from '@n8n/design-system'; import { useI18n, type BaseTextKey } from '@n8n/i18n'; @@ -270,44 +271,11 @@ watch( :class="$style.sample" :data-test-id="testId && `${testId}-placeholder`" > -