mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat: Don't allow multiple active workflows with same form path (#16722)
This commit is contained in:
@@ -4,6 +4,7 @@ import WorkflowActivationConflictingWebhookModal from '@/components/WorkflowActi
|
||||
import { WORKFLOW_ACTIVATION_CONFLICTING_WEBHOOK_MODAL_KEY } from '@/constants';
|
||||
|
||||
import { waitFor } from '@testing-library/vue';
|
||||
import { FORM_TRIGGER_NODE_TYPE, WEBHOOK_NODE_TYPE } from 'n8n-workflow';
|
||||
|
||||
vi.mock('@/stores/ui.store', () => {
|
||||
return {
|
||||
@@ -37,12 +38,13 @@ describe('WorkflowActivationConflictingWebhookModal', () => {
|
||||
createTestingPinia();
|
||||
});
|
||||
|
||||
it('should render modal', async () => {
|
||||
it('should render webhook conflict modal', async () => {
|
||||
const props = {
|
||||
modalName: WORKFLOW_ACTIVATION_CONFLICTING_WEBHOOK_MODAL_KEY,
|
||||
data: {
|
||||
triggerName: 'Trigger in this workflow',
|
||||
workflowName: 'Test Workflow',
|
||||
triggerType: WEBHOOK_NODE_TYPE,
|
||||
workflowId: '123',
|
||||
webhookPath: 'webhook-path',
|
||||
method: 'GET',
|
||||
@@ -62,4 +64,31 @@ describe('WorkflowActivationConflictingWebhookModal', () => {
|
||||
'http://webhook-base/webhook-path',
|
||||
);
|
||||
});
|
||||
|
||||
it('should render form conflict modal', async () => {
|
||||
const props = {
|
||||
modalName: WORKFLOW_ACTIVATION_CONFLICTING_WEBHOOK_MODAL_KEY,
|
||||
data: {
|
||||
triggerName: 'Trigger in this workflow',
|
||||
workflowName: 'Test Form',
|
||||
triggerType: FORM_TRIGGER_NODE_TYPE,
|
||||
workflowId: '123',
|
||||
webhookPath: 'form-path',
|
||||
method: 'GET',
|
||||
node: 'Node in workflow',
|
||||
},
|
||||
};
|
||||
|
||||
const wrapper = renderComponent({ props });
|
||||
await waitFor(() => {
|
||||
expect(wrapper.queryByTestId('conflicting-webhook-callout')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
expect(wrapper.getByTestId('conflicting-webhook-callout')).toHaveTextContent(
|
||||
"A form trigger 'Node in workflow' in the workflow 'Test Form' uses a conflicting URL path, so this workflow cannot be activated",
|
||||
);
|
||||
expect(wrapper.getByTestId('conflicting-webhook-path')).toHaveTextContent(
|
||||
'http://webhook-base/form-path',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user