mirror of
https://github.com/n8n-io/n8n.git
synced 2026-10-17 05:29:44 +02:00
fix(editor): Keep workflow name in edit mode after Rename menu action (#41120)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
116a81e06e
commit
fc9f9575e2
|
|
@ -203,6 +203,8 @@ const workflowMenuItems = computed<WorkflowMenuItem[]>(() => {
|
|||
label: locale.baseText('generic.rename'),
|
||||
icon: { type: 'icon', value: 'pencil' },
|
||||
disabled: props.workflowPermissions.update !== true,
|
||||
// Focus moves to the name input; returning it to the trigger blurs and ends the edit.
|
||||
suppressCloseAutoFocus: true,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -292,6 +292,21 @@ describe('WorkflowDetails', () => {
|
|||
});
|
||||
|
||||
describe('Workflow menu', () => {
|
||||
it('should keep the name input in edit mode after the rename action', async () => {
|
||||
workflowDocumentStoreRef.value?.setScopes(['workflow:update']);
|
||||
const { getByTestId, queryByTestId } = renderComponent({
|
||||
props: { ...defaultProps },
|
||||
});
|
||||
|
||||
await userEvent.click(getByTestId('workflow-menu'));
|
||||
await userEvent.click(getByTestId('workflow-menu-item-rename'));
|
||||
|
||||
await vi.waitFor(() =>
|
||||
expect(queryByTestId('workflow-menu-item-rename')).not.toBeInTheDocument(),
|
||||
);
|
||||
expect(getByTestId('inline-edit-input')).toHaveFocus();
|
||||
});
|
||||
|
||||
it('should not show a dependencies entry when the workflow has none', async () => {
|
||||
workflowDocumentStoreRef.value?.setScopes(['workflow:read']);
|
||||
const { getByTestId, queryByTestId } = renderComponent({
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user