mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 03:12:15 +00:00
feat(editor): Add "Change owner" option to editor (#15792)
This commit is contained in:
committed by
GitHub
parent
e76c45d46d
commit
5bc4e5d846
@@ -6,7 +6,9 @@ import {
|
||||
MODAL_CONFIRM,
|
||||
VIEWS,
|
||||
WORKFLOW_SHARE_MODAL_KEY,
|
||||
PROJECT_MOVE_RESOURCE_MODAL,
|
||||
} from '@/constants';
|
||||
import type { IWorkflowDb } from '@/Interface';
|
||||
import { STORES } from '@n8n/stores';
|
||||
import { createTestingPinia } from '@pinia/testing';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
@@ -59,6 +61,11 @@ const initialState = {
|
||||
enterprise: {
|
||||
[EnterpriseEditionFeature.Sharing]: true,
|
||||
[EnterpriseEditionFeature.WorkflowHistory]: true,
|
||||
projects: {
|
||||
team: {
|
||||
limit: -1,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
areTagsEnabled: true,
|
||||
@@ -394,6 +401,27 @@ describe('WorkflowDetails', () => {
|
||||
name: VIEWS.WORKFLOWS,
|
||||
});
|
||||
});
|
||||
|
||||
it("should call onWorkflowMenuSelect on 'Change owner' option click", async () => {
|
||||
const openModalSpy = vi.spyOn(uiStore, 'openModalWithData');
|
||||
|
||||
workflowsStore.workflowsById = { [workflow.id]: workflow as IWorkflowDb };
|
||||
|
||||
const { getByTestId } = renderComponent({
|
||||
props: {
|
||||
...workflow,
|
||||
scopes: ['workflow:move'],
|
||||
},
|
||||
});
|
||||
|
||||
await userEvent.click(getByTestId('workflow-menu'));
|
||||
await userEvent.click(getByTestId('workflow-menu-item-change-owner'));
|
||||
|
||||
expect(openModalSpy).toHaveBeenCalledWith({
|
||||
name: PROJECT_MOVE_RESOURCE_MODAL,
|
||||
data: expect.objectContaining({ resource: expect.objectContaining({ id: workflow.id }) }),
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('Archived badge', () => {
|
||||
|
||||
Reference in New Issue
Block a user