diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index a4f667ac46..330174e6dd 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -11,3 +11,7 @@ # refactor: Run lintfix (no-changelog) (#7537) 62c096710fab2f7e886518abdbded34b55e93f62 + +# refactor: Move test files alongside tested files (#11504) + +7e58fc4fec468aca0b45d5bfe6150e1af632acbc diff --git a/packages/editor-ui/src/components/AssignmentCollection/__tests__/Assignment.test.ts b/packages/editor-ui/src/components/AssignmentCollection/Assignment.test.ts similarity index 97% rename from packages/editor-ui/src/components/AssignmentCollection/__tests__/Assignment.test.ts rename to packages/editor-ui/src/components/AssignmentCollection/Assignment.test.ts index be96dc8dd9..164047d475 100644 --- a/packages/editor-ui/src/components/AssignmentCollection/__tests__/Assignment.test.ts +++ b/packages/editor-ui/src/components/AssignmentCollection/Assignment.test.ts @@ -1,7 +1,7 @@ import { createComponentRenderer } from '@/__tests__/render'; import { createTestingPinia } from '@pinia/testing'; import userEvent from '@testing-library/user-event'; -import Assignment from '../Assignment.vue'; +import Assignment from './Assignment.vue'; import { defaultSettings } from '@/__tests__/defaults'; import { STORES } from '@/constants'; import { merge } from 'lodash-es'; diff --git a/packages/editor-ui/src/components/AssignmentCollection/__tests__/AssignmentCollection.test.ts b/packages/editor-ui/src/components/AssignmentCollection/AssignmentCollection.test.ts similarity index 97% rename from packages/editor-ui/src/components/AssignmentCollection/__tests__/AssignmentCollection.test.ts rename to packages/editor-ui/src/components/AssignmentCollection/AssignmentCollection.test.ts index 626df62a4a..534c734638 100644 --- a/packages/editor-ui/src/components/AssignmentCollection/__tests__/AssignmentCollection.test.ts +++ b/packages/editor-ui/src/components/AssignmentCollection/AssignmentCollection.test.ts @@ -4,7 +4,7 @@ import { createTestingPinia } from '@pinia/testing'; import userEvent from '@testing-library/user-event'; import { fireEvent, within } from '@testing-library/vue'; import * as workflowHelpers from '@/composables/useWorkflowHelpers'; -import AssignmentCollection from '../AssignmentCollection.vue'; +import AssignmentCollection from './AssignmentCollection.vue'; import { STORES } from '@/constants'; import { cleanupAppModals, createAppModals, SETTINGS_STORE_DEFAULT_STATE } from '@/__tests__/utils'; @@ -117,7 +117,7 @@ describe('AssignmentCollection.vue', () => { await dropAssignment({ key: 'objectKey', value: {}, dropArea }); await dropAssignment({ key: 'arrayKey', value: [], dropArea }); - let assignments = await findAllByTestId('assignment'); + const assignments = await findAllByTestId('assignment'); expect(assignments.length).toBe(5); expect(getAssignmentType(assignments[0])).toEqual('Boolean'); diff --git a/packages/editor-ui/src/components/AssignmentCollection/__tests__/TypeSelect.test.ts b/packages/editor-ui/src/components/AssignmentCollection/TypeSelect.test.ts similarity index 96% rename from packages/editor-ui/src/components/AssignmentCollection/__tests__/TypeSelect.test.ts rename to packages/editor-ui/src/components/AssignmentCollection/TypeSelect.test.ts index 78f4b683c6..19360f22d3 100644 --- a/packages/editor-ui/src/components/AssignmentCollection/__tests__/TypeSelect.test.ts +++ b/packages/editor-ui/src/components/AssignmentCollection/TypeSelect.test.ts @@ -1,7 +1,7 @@ import { createComponentRenderer } from '@/__tests__/render'; import { createTestingPinia } from '@pinia/testing'; import userEvent from '@testing-library/user-event'; -import TypeSelect from '../TypeSelect.vue'; +import TypeSelect from './TypeSelect.vue'; const DEFAULT_SETUP = { pinia: createTestingPinia(), diff --git a/packages/editor-ui/src/components/__tests__/BannersStack.test.ts b/packages/editor-ui/src/components/BannersStack.test.ts similarity index 100% rename from packages/editor-ui/src/components/__tests__/BannersStack.test.ts rename to packages/editor-ui/src/components/BannersStack.test.ts diff --git a/packages/editor-ui/src/components/__tests__/ButtonParameter.test.ts b/packages/editor-ui/src/components/ButtonParameter.test.ts similarity index 100% rename from packages/editor-ui/src/components/__tests__/ButtonParameter.test.ts rename to packages/editor-ui/src/components/ButtonParameter.test.ts diff --git a/packages/editor-ui/src/components/__tests__/ChangePasswordModal.test.ts b/packages/editor-ui/src/components/ChangePasswordModal.test.ts similarity index 100% rename from packages/editor-ui/src/components/__tests__/ChangePasswordModal.test.ts rename to packages/editor-ui/src/components/ChangePasswordModal.test.ts diff --git a/packages/editor-ui/src/components/__tests__/ChatEmbedModal.test.ts b/packages/editor-ui/src/components/ChatEmbedModal.test.ts similarity index 100% rename from packages/editor-ui/src/components/__tests__/ChatEmbedModal.test.ts rename to packages/editor-ui/src/components/ChatEmbedModal.test.ts diff --git a/packages/editor-ui/src/components/CodeNodeEditor/completions/__tests__/itemField.completions.test.ts b/packages/editor-ui/src/components/CodeNodeEditor/completions/itemField.completions.test.ts similarity index 96% rename from packages/editor-ui/src/components/CodeNodeEditor/completions/__tests__/itemField.completions.test.ts rename to packages/editor-ui/src/components/CodeNodeEditor/completions/itemField.completions.test.ts index 98ba5e0f6f..7bcba353e4 100644 --- a/packages/editor-ui/src/components/CodeNodeEditor/completions/__tests__/itemField.completions.test.ts +++ b/packages/editor-ui/src/components/CodeNodeEditor/completions/itemField.completions.test.ts @@ -1,6 +1,6 @@ import { CompletionContext } from '@codemirror/autocomplete'; import { EditorSelection, EditorState } from '@codemirror/state'; -import { useItemFieldCompletions } from '../itemField.completions'; +import { useItemFieldCompletions } from './itemField.completions'; describe('inputMethodCompletions', () => { test('should return completions for $input.item.|', () => { diff --git a/packages/editor-ui/src/components/__tests__/CollaborationPane.test.ts b/packages/editor-ui/src/components/CollaborationPane.test.ts similarity index 100% rename from packages/editor-ui/src/components/__tests__/CollaborationPane.test.ts rename to packages/editor-ui/src/components/CollaborationPane.test.ts diff --git a/packages/editor-ui/src/components/__tests__/CollectionParameter.test.ts b/packages/editor-ui/src/components/CollectionParameter.test.ts similarity index 94% rename from packages/editor-ui/src/components/__tests__/CollectionParameter.test.ts rename to packages/editor-ui/src/components/CollectionParameter.test.ts index 8f1c0b0af2..4b0e25c063 100644 --- a/packages/editor-ui/src/components/__tests__/CollectionParameter.test.ts +++ b/packages/editor-ui/src/components/CollectionParameter.test.ts @@ -1,6 +1,6 @@ import { createComponentRenderer } from '@/__tests__/render'; import { createTestingPinia } from '@pinia/testing'; -import CollectionParameter from '../CollectionParameter.vue'; +import CollectionParameter from './CollectionParameter.vue'; const renderComponent = createComponentRenderer(CollectionParameter, { pinia: createTestingPinia(), diff --git a/packages/editor-ui/src/components/__tests__/CommunityPackageInstallModal.spec.ts b/packages/editor-ui/src/components/CommunityPackageInstallModal.spec.ts similarity index 95% rename from packages/editor-ui/src/components/__tests__/CommunityPackageInstallModal.spec.ts rename to packages/editor-ui/src/components/CommunityPackageInstallModal.spec.ts index a93ba7c878..bbf2701068 100644 --- a/packages/editor-ui/src/components/__tests__/CommunityPackageInstallModal.spec.ts +++ b/packages/editor-ui/src/components/CommunityPackageInstallModal.spec.ts @@ -1,5 +1,5 @@ import { createComponentRenderer } from '@/__tests__/render'; -import CommunityPackageInstallModal from '../CommunityPackageInstallModal.vue'; +import CommunityPackageInstallModal from './CommunityPackageInstallModal.vue'; import { createTestingPinia } from '@pinia/testing'; import { COMMUNITY_PACKAGE_INSTALL_MODAL_KEY, STORES } from '@/constants'; import userEvent from '@testing-library/user-event'; diff --git a/packages/editor-ui/src/components/__tests__/CopyInput.test.ts b/packages/editor-ui/src/components/CopyInput.test.ts similarity index 100% rename from packages/editor-ui/src/components/__tests__/CopyInput.test.ts rename to packages/editor-ui/src/components/CopyInput.test.ts diff --git a/packages/editor-ui/src/components/CredentialEdit/__tests__/OauthButton.test.ts b/packages/editor-ui/src/components/CredentialEdit/OauthButton.test.ts similarity index 100% rename from packages/editor-ui/src/components/CredentialEdit/__tests__/OauthButton.test.ts rename to packages/editor-ui/src/components/CredentialEdit/OauthButton.test.ts diff --git a/packages/editor-ui/src/components/__tests__/CredentialIcon.test.ts b/packages/editor-ui/src/components/CredentialIcon.test.ts similarity index 97% rename from packages/editor-ui/src/components/__tests__/CredentialIcon.test.ts rename to packages/editor-ui/src/components/CredentialIcon.test.ts index 79bcc4b882..32a8ef6d72 100644 --- a/packages/editor-ui/src/components/__tests__/CredentialIcon.test.ts +++ b/packages/editor-ui/src/components/CredentialIcon.test.ts @@ -7,7 +7,7 @@ import CredentialIcon from '@/components/CredentialIcon.vue'; import { createComponentRenderer } from '@/__tests__/render'; import { useCredentialsStore } from '@/stores/credentials.store'; import { useRootStore } from '@/stores/root.store'; -import { useNodeTypesStore } from '../../stores/nodeTypes.store'; +import { useNodeTypesStore } from '../stores/nodeTypes.store'; describe('CredentialIcon', () => { const renderComponent = createComponentRenderer(CredentialIcon, { diff --git a/packages/editor-ui/src/components/DropArea/__tests__/DropArea.test.ts b/packages/editor-ui/src/components/DropArea/DropArea.test.ts similarity index 96% rename from packages/editor-ui/src/components/DropArea/__tests__/DropArea.test.ts rename to packages/editor-ui/src/components/DropArea/DropArea.test.ts index d9c8371d72..2ad454006a 100644 --- a/packages/editor-ui/src/components/DropArea/__tests__/DropArea.test.ts +++ b/packages/editor-ui/src/components/DropArea/DropArea.test.ts @@ -4,7 +4,7 @@ import { createTestingPinia } from '@pinia/testing'; import userEvent from '@testing-library/user-event'; import { fireEvent } from '@testing-library/vue'; import { createPinia, setActivePinia } from 'pinia'; -import DropArea from '../DropArea.vue'; +import DropArea from './DropArea.vue'; const renderComponent = createComponentRenderer(DropArea, { pinia: createTestingPinia(), diff --git a/packages/editor-ui/src/components/Error/__tests__/NodeErrorView.test.ts b/packages/editor-ui/src/components/Error/NodeErrorView.test.ts similarity index 100% rename from packages/editor-ui/src/components/Error/__tests__/NodeErrorView.test.ts rename to packages/editor-ui/src/components/Error/NodeErrorView.test.ts diff --git a/packages/editor-ui/src/components/__tests__/ExpressionEditorModalInput.test.ts b/packages/editor-ui/src/components/ExpressionEditorModalInput.test.ts similarity index 100% rename from packages/editor-ui/src/components/__tests__/ExpressionEditorModalInput.test.ts rename to packages/editor-ui/src/components/ExpressionEditorModalInput.test.ts diff --git a/packages/editor-ui/src/components/__tests__/ExpressionParameterInput.test.ts b/packages/editor-ui/src/components/ExpressionParameterInput.test.ts similarity index 100% rename from packages/editor-ui/src/components/__tests__/ExpressionParameterInput.test.ts rename to packages/editor-ui/src/components/ExpressionParameterInput.test.ts diff --git a/packages/editor-ui/src/components/FilterConditions/__tests__/FilterConditions.test.ts b/packages/editor-ui/src/components/FilterConditions/FilterConditions.test.ts similarity index 99% rename from packages/editor-ui/src/components/FilterConditions/__tests__/FilterConditions.test.ts rename to packages/editor-ui/src/components/FilterConditions/FilterConditions.test.ts index 0f00c1bd3d..24cd1ef73c 100644 --- a/packages/editor-ui/src/components/FilterConditions/__tests__/FilterConditions.test.ts +++ b/packages/editor-ui/src/components/FilterConditions/FilterConditions.test.ts @@ -6,7 +6,7 @@ import { useNDVStore } from '@/stores/ndv.store'; import { createTestingPinia } from '@pinia/testing'; import userEvent from '@testing-library/user-event'; import { within, waitFor } from '@testing-library/vue'; -import { getFilterOperator } from '../utils'; +import { getFilterOperator } from './utils'; import { get } from 'lodash-es'; const DEFAULT_SETUP = { diff --git a/packages/editor-ui/src/components/FilterConditions/__tests__/utils.test.ts b/packages/editor-ui/src/components/FilterConditions/utils.test.ts similarity index 98% rename from packages/editor-ui/src/components/FilterConditions/__tests__/utils.test.ts rename to packages/editor-ui/src/components/FilterConditions/utils.test.ts index aac05defc1..7cdfb76e23 100644 --- a/packages/editor-ui/src/components/FilterConditions/__tests__/utils.test.ts +++ b/packages/editor-ui/src/components/FilterConditions/utils.test.ts @@ -1,4 +1,4 @@ -import { getFilterOperator, handleOperatorChange, inferOperatorType } from '../utils'; +import { getFilterOperator, handleOperatorChange, inferOperatorType } from './utils'; describe('FilterConditions > utils', () => { describe('handleOperatorChange', () => { diff --git a/packages/editor-ui/src/components/__tests__/HtmlEditor.test.ts b/packages/editor-ui/src/components/HtmlEditor.test.ts similarity index 97% rename from packages/editor-ui/src/components/__tests__/HtmlEditor.test.ts rename to packages/editor-ui/src/components/HtmlEditor.test.ts index 7d5f80d428..5de134f652 100644 --- a/packages/editor-ui/src/components/__tests__/HtmlEditor.test.ts +++ b/packages/editor-ui/src/components/HtmlEditor.test.ts @@ -7,7 +7,7 @@ import HtmlEditor from '@/components/HtmlEditor/HtmlEditor.vue'; import { userEvent } from '@testing-library/user-event'; import { waitFor } from '@testing-library/vue'; import { setActivePinia } from 'pinia'; -import { htmlEditorEventBus } from '../../event-bus'; +import { htmlEditorEventBus } from '../event-bus'; const DEFAULT_SETUP = { props: { diff --git a/packages/editor-ui/src/components/InlineExpressionEditor/__tests__/InlineExpressionEditorOutput.test.ts b/packages/editor-ui/src/components/InlineExpressionEditor/InlineExpressionEditorOutput.test.ts similarity index 96% rename from packages/editor-ui/src/components/InlineExpressionEditor/__tests__/InlineExpressionEditorOutput.test.ts rename to packages/editor-ui/src/components/InlineExpressionEditor/InlineExpressionEditorOutput.test.ts index 8728fecb8c..76d3f2452c 100644 --- a/packages/editor-ui/src/components/InlineExpressionEditor/__tests__/InlineExpressionEditorOutput.test.ts +++ b/packages/editor-ui/src/components/InlineExpressionEditor/InlineExpressionEditorOutput.test.ts @@ -1,6 +1,6 @@ import { renderComponent } from '@/__tests__/render'; import { createTestingPinia } from '@pinia/testing'; -import InlineExpressionEditorOutput from '../InlineExpressionEditorOutput.vue'; +import InlineExpressionEditorOutput from './InlineExpressionEditorOutput.vue'; describe('InlineExpressionEditorOutput.vue', () => { test('should render duplicate segments correctly', async () => { diff --git a/packages/editor-ui/src/components/InlineExpressionEditor/__tests__/InlineExpressionTip.test.ts b/packages/editor-ui/src/components/InlineExpressionEditor/InlineExpressionTip.test.ts similarity index 100% rename from packages/editor-ui/src/components/InlineExpressionEditor/__tests__/InlineExpressionTip.test.ts rename to packages/editor-ui/src/components/InlineExpressionEditor/InlineExpressionTip.test.ts diff --git a/packages/editor-ui/src/components/InputTriple/__tests__/InputTriple.test.ts b/packages/editor-ui/src/components/InputTriple/InputTriple.test.ts similarity index 95% rename from packages/editor-ui/src/components/InputTriple/__tests__/InputTriple.test.ts rename to packages/editor-ui/src/components/InputTriple/InputTriple.test.ts index a29373ec25..a802317e0e 100644 --- a/packages/editor-ui/src/components/InputTriple/__tests__/InputTriple.test.ts +++ b/packages/editor-ui/src/components/InputTriple/InputTriple.test.ts @@ -1,5 +1,5 @@ import { createComponentRenderer } from '@/__tests__/render'; -import InputTriple from '../InputTriple.vue'; +import InputTriple from './InputTriple.vue'; const renderComponent = createComponentRenderer(InputTriple); diff --git a/packages/editor-ui/src/components/__tests__/JsEditor.test.ts b/packages/editor-ui/src/components/JsEditor.test.ts similarity index 100% rename from packages/editor-ui/src/components/__tests__/JsEditor.test.ts rename to packages/editor-ui/src/components/JsEditor.test.ts diff --git a/packages/editor-ui/src/components/__tests__/JsonEditor.test.ts b/packages/editor-ui/src/components/JsonEditor.test.ts similarity index 100% rename from packages/editor-ui/src/components/__tests__/JsonEditor.test.ts rename to packages/editor-ui/src/components/JsonEditor.test.ts diff --git a/packages/editor-ui/src/components/__tests__/MainSidebarSourceControl.test.ts b/packages/editor-ui/src/components/MainSidebarSourceControl.test.ts similarity index 100% rename from packages/editor-ui/src/components/__tests__/MainSidebarSourceControl.test.ts rename to packages/editor-ui/src/components/MainSidebarSourceControl.test.ts diff --git a/packages/editor-ui/src/components/Node/NodeCreator/__tests__/CategoryItem.test.ts b/packages/editor-ui/src/components/Node/NodeCreator/CategoryItem.test.ts similarity index 95% rename from packages/editor-ui/src/components/Node/NodeCreator/__tests__/CategoryItem.test.ts rename to packages/editor-ui/src/components/Node/NodeCreator/CategoryItem.test.ts index fa290aa550..4d64abb728 100644 --- a/packages/editor-ui/src/components/Node/NodeCreator/__tests__/CategoryItem.test.ts +++ b/packages/editor-ui/src/components/Node/NodeCreator/CategoryItem.test.ts @@ -1,5 +1,5 @@ import { screen } from '@testing-library/vue'; -import CategoryItem from '../ItemTypes/CategoryItem.vue'; +import CategoryItem from './ItemTypes/CategoryItem.vue'; import { createComponentRenderer } from '@/__tests__/render'; const renderComponent = createComponentRenderer(CategoryItem); diff --git a/packages/editor-ui/src/components/Node/NodeCreator/__tests__/ItemsRenderer.test.ts b/packages/editor-ui/src/components/Node/NodeCreator/ItemsRenderer.test.ts similarity index 99% rename from packages/editor-ui/src/components/Node/NodeCreator/__tests__/ItemsRenderer.test.ts rename to packages/editor-ui/src/components/Node/NodeCreator/ItemsRenderer.test.ts index f0737f328e..717e7a1eb1 100644 --- a/packages/editor-ui/src/components/Node/NodeCreator/__tests__/ItemsRenderer.test.ts +++ b/packages/editor-ui/src/components/Node/NodeCreator/ItemsRenderer.test.ts @@ -8,7 +8,7 @@ import { mockActionCreateElement, mockViewCreateElement, mockSectionCreateElement, -} from './utils'; +} from './__tests__/utils'; import ItemsRenderer from '@/components/Node/NodeCreator/Renderers/ItemsRenderer.vue'; import { createComponentRenderer } from '@/__tests__/render'; diff --git a/packages/editor-ui/src/components/Node/NodeCreator/__tests__/NodesListPanel.test.ts b/packages/editor-ui/src/components/Node/NodeCreator/NodesListPanel.test.ts similarity index 98% rename from packages/editor-ui/src/components/Node/NodeCreator/__tests__/NodesListPanel.test.ts rename to packages/editor-ui/src/components/Node/NodeCreator/NodesListPanel.test.ts index 62db84094e..c451f2c764 100644 --- a/packages/editor-ui/src/components/Node/NodeCreator/__tests__/NodesListPanel.test.ts +++ b/packages/editor-ui/src/components/Node/NodeCreator/NodesListPanel.test.ts @@ -4,8 +4,8 @@ import { createPinia } from 'pinia'; import { screen, fireEvent } from '@testing-library/vue'; import type { INodeTypeDescription } from 'n8n-workflow'; import { useNodeCreatorStore } from '@/stores/nodeCreator.store'; -import { mockSimplifiedNodeType } from './utils'; -import NodesListPanel from '../Panel/NodesListPanel.vue'; +import { mockSimplifiedNodeType } from './__tests__/utils'; +import NodesListPanel from './Panel/NodesListPanel.vue'; import { REGULAR_NODE_CREATOR_VIEW } from '@/constants'; import type { NodeFilterType } from '@/Interface'; import { createComponentRenderer } from '@/__tests__/render'; diff --git a/packages/editor-ui/src/components/Node/NodeCreator/__tests__/useActions.test.ts b/packages/editor-ui/src/components/Node/NodeCreator/useActions.test.ts similarity index 99% rename from packages/editor-ui/src/components/Node/NodeCreator/__tests__/useActions.test.ts rename to packages/editor-ui/src/components/Node/NodeCreator/useActions.test.ts index 14a03254e1..4b5682cbbd 100644 --- a/packages/editor-ui/src/components/Node/NodeCreator/__tests__/useActions.test.ts +++ b/packages/editor-ui/src/components/Node/NodeCreator/useActions.test.ts @@ -3,7 +3,7 @@ import { createTestingPinia } from '@pinia/testing'; import { useNodeCreatorStore } from '@/stores/nodeCreator.store'; import { useNodeTypesStore } from '@/stores/nodeTypes.store'; import { useWorkflowsStore } from '@/stores/workflows.store'; -import { useActions } from '../composables/useActions'; +import { useActions } from './composables/useActions'; import { HTTP_REQUEST_NODE_TYPE, MANUAL_TRIGGER_NODE_TYPE, diff --git a/packages/editor-ui/src/components/Node/NodeCreator/__tests__/useActionsGeneration.test.ts b/packages/editor-ui/src/components/Node/NodeCreator/useActionsGeneration.test.ts similarity index 99% rename from packages/editor-ui/src/components/Node/NodeCreator/__tests__/useActionsGeneration.test.ts rename to packages/editor-ui/src/components/Node/NodeCreator/useActionsGeneration.test.ts index 171e2a0b48..679fd05284 100644 --- a/packages/editor-ui/src/components/Node/NodeCreator/__tests__/useActionsGeneration.test.ts +++ b/packages/editor-ui/src/components/Node/NodeCreator/useActionsGeneration.test.ts @@ -1,5 +1,5 @@ import { NodeConnectionType, type INodeProperties, type INodeTypeDescription } from 'n8n-workflow'; -import { useActionsGenerator } from '../composables/useActionsGeneration'; +import { useActionsGenerator } from './composables/useActionsGeneration'; describe('useActionsGenerator', () => { const { generateMergedNodesAndActions } = useActionsGenerator(); diff --git a/packages/editor-ui/src/components/Node/NodeCreator/__tests__/useKeyboardNavigation.test.ts b/packages/editor-ui/src/components/Node/NodeCreator/useKeyboardNavigation.test.ts similarity index 97% rename from packages/editor-ui/src/components/Node/NodeCreator/__tests__/useKeyboardNavigation.test.ts rename to packages/editor-ui/src/components/Node/NodeCreator/useKeyboardNavigation.test.ts index b53190db39..d8d3b7f934 100644 --- a/packages/editor-ui/src/components/Node/NodeCreator/__tests__/useKeyboardNavigation.test.ts +++ b/packages/editor-ui/src/components/Node/NodeCreator/useKeyboardNavigation.test.ts @@ -1,6 +1,6 @@ import userEvent from '@testing-library/user-event'; import { defineComponent, computed } from 'vue'; -import { useKeyboardNavigation } from '../composables/useKeyboardNavigation'; +import { useKeyboardNavigation } from './composables/useKeyboardNavigation'; import { createComponentRenderer } from '@/__tests__/render'; import { createPinia } from 'pinia'; diff --git a/packages/editor-ui/src/components/Node/NodeCreator/__tests__/utils.test.ts b/packages/editor-ui/src/components/Node/NodeCreator/utils.test.ts similarity index 95% rename from packages/editor-ui/src/components/Node/NodeCreator/__tests__/utils.test.ts rename to packages/editor-ui/src/components/Node/NodeCreator/utils.test.ts index 6d8174dfaa..deabf36577 100644 --- a/packages/editor-ui/src/components/Node/NodeCreator/__tests__/utils.test.ts +++ b/packages/editor-ui/src/components/Node/NodeCreator/utils.test.ts @@ -1,6 +1,10 @@ import type { SectionCreateElement } from '@/Interface'; -import { formatTriggerActionName, groupItemsInSections, sortNodeCreateElements } from '../utils'; -import { mockActionCreateElement, mockNodeCreateElement, mockSectionCreateElement } from './utils'; +import { formatTriggerActionName, groupItemsInSections, sortNodeCreateElements } from './utils'; +import { + mockActionCreateElement, + mockNodeCreateElement, + mockSectionCreateElement, +} from './__tests__/utils'; describe('NodeCreator - utils', () => { describe('groupItemsInSections', () => { diff --git a/packages/editor-ui/src/components/__tests__/NodeDetailsView.test.ts b/packages/editor-ui/src/components/NodeDetailsView.test.ts similarity index 100% rename from packages/editor-ui/src/components/__tests__/NodeDetailsView.test.ts rename to packages/editor-ui/src/components/NodeDetailsView.test.ts diff --git a/packages/editor-ui/src/components/__tests__/ParameterInput.test.ts b/packages/editor-ui/src/components/ParameterInput.test.ts similarity index 98% rename from packages/editor-ui/src/components/__tests__/ParameterInput.test.ts rename to packages/editor-ui/src/components/ParameterInput.test.ts index 3deee4ef26..05637e3903 100644 --- a/packages/editor-ui/src/components/__tests__/ParameterInput.test.ts +++ b/packages/editor-ui/src/components/ParameterInput.test.ts @@ -6,7 +6,7 @@ import { createTestingPinia } from '@pinia/testing'; import { faker } from '@faker-js/faker'; import { waitFor } from '@testing-library/vue'; import userEvent from '@testing-library/user-event'; -import type { useNodeTypesStore } from '../../stores/nodeTypes.store'; +import type { useNodeTypesStore } from '@/stores/nodeTypes.store'; import { cleanupAppModals, createAppModals } from '@/__tests__/utils'; let mockNdvState: Partial>; diff --git a/packages/editor-ui/src/components/__tests__/RBAC.test.ts b/packages/editor-ui/src/components/RBAC.test.ts similarity index 100% rename from packages/editor-ui/src/components/__tests__/RBAC.test.ts rename to packages/editor-ui/src/components/RBAC.test.ts diff --git a/packages/editor-ui/src/components/__tests__/ResourceMapper.test.ts b/packages/editor-ui/src/components/ResourceMapper.test.ts similarity index 99% rename from packages/editor-ui/src/components/__tests__/ResourceMapper.test.ts rename to packages/editor-ui/src/components/ResourceMapper.test.ts index a9e42dddfd..25db059504 100644 --- a/packages/editor-ui/src/components/__tests__/ResourceMapper.test.ts +++ b/packages/editor-ui/src/components/ResourceMapper.test.ts @@ -2,7 +2,7 @@ import { DEFAULT_SETUP, MAPPING_COLUMNS_RESPONSE, UPDATED_SCHEMA, -} from './utils/ResourceMapper.utils'; +} from './__tests__/utils/ResourceMapper.utils'; import { useNodeTypesStore } from '@/stores/nodeTypes.store'; import { cleanupAppModals, createAppModals, waitAllPromises } from '@/__tests__/utils'; import ResourceMapper from '@/components/ResourceMapper/ResourceMapper.vue'; diff --git a/packages/editor-ui/src/components/__tests__/RunData.test.ts b/packages/editor-ui/src/components/RunData.test.ts similarity index 100% rename from packages/editor-ui/src/components/__tests__/RunData.test.ts rename to packages/editor-ui/src/components/RunData.test.ts diff --git a/packages/editor-ui/src/components/__tests__/RunDataJson.test.ts b/packages/editor-ui/src/components/RunDataJson.test.ts similarity index 100% rename from packages/editor-ui/src/components/__tests__/RunDataJson.test.ts rename to packages/editor-ui/src/components/RunDataJson.test.ts diff --git a/packages/editor-ui/src/components/__tests__/RunDataPinButton.test.ts b/packages/editor-ui/src/components/RunDataPinButton.test.ts similarity index 100% rename from packages/editor-ui/src/components/__tests__/RunDataPinButton.test.ts rename to packages/editor-ui/src/components/RunDataPinButton.test.ts diff --git a/packages/editor-ui/src/components/__tests__/RunDataSchema.test.ts b/packages/editor-ui/src/components/RunDataSchema.test.ts similarity index 100% rename from packages/editor-ui/src/components/__tests__/RunDataSchema.test.ts rename to packages/editor-ui/src/components/RunDataSchema.test.ts diff --git a/packages/editor-ui/src/components/__tests__/RunDataSearch.test.ts b/packages/editor-ui/src/components/RunDataSearch.test.ts similarity index 100% rename from packages/editor-ui/src/components/__tests__/RunDataSearch.test.ts rename to packages/editor-ui/src/components/RunDataSearch.test.ts diff --git a/packages/editor-ui/src/components/__tests__/SQLEditor.test.ts b/packages/editor-ui/src/components/SQLEditor.test.ts similarity index 100% rename from packages/editor-ui/src/components/__tests__/SQLEditor.test.ts rename to packages/editor-ui/src/components/SQLEditor.test.ts diff --git a/packages/editor-ui/src/components/__tests__/SSOLogin.test.ts b/packages/editor-ui/src/components/SSOLogin.test.ts similarity index 100% rename from packages/editor-ui/src/components/__tests__/SSOLogin.test.ts rename to packages/editor-ui/src/components/SSOLogin.test.ts diff --git a/packages/editor-ui/src/components/__tests__/TemplatesInfoCard.test.ts b/packages/editor-ui/src/components/TemplatesInfoCard.test.ts similarity index 100% rename from packages/editor-ui/src/components/__tests__/TemplatesInfoCard.test.ts rename to packages/editor-ui/src/components/TemplatesInfoCard.test.ts diff --git a/packages/editor-ui/src/components/__tests__/TextWithHIghlights.test.ts b/packages/editor-ui/src/components/TextWithHIghlights.test.ts similarity index 100% rename from packages/editor-ui/src/components/__tests__/TextWithHIghlights.test.ts rename to packages/editor-ui/src/components/TextWithHIghlights.test.ts diff --git a/packages/editor-ui/src/components/__tests__/VariablesRow.spec.ts b/packages/editor-ui/src/components/VariablesRow.spec.ts similarity index 98% rename from packages/editor-ui/src/components/__tests__/VariablesRow.spec.ts rename to packages/editor-ui/src/components/VariablesRow.spec.ts index 88928b0e80..7d7013054f 100644 --- a/packages/editor-ui/src/components/__tests__/VariablesRow.spec.ts +++ b/packages/editor-ui/src/components/VariablesRow.spec.ts @@ -1,4 +1,4 @@ -import VariablesRow from '../VariablesRow.vue'; +import VariablesRow from './VariablesRow.vue'; import { fireEvent } from '@testing-library/vue'; import { setupServer } from '@/__tests__/server'; import { afterAll, beforeAll } from 'vitest'; diff --git a/packages/editor-ui/src/components/WorkflowHistory/__tests__/WorkflowHistoryContent.test.ts b/packages/editor-ui/src/components/WorkflowHistory/WorkflowHistoryContent.test.ts similarity index 100% rename from packages/editor-ui/src/components/WorkflowHistory/__tests__/WorkflowHistoryContent.test.ts rename to packages/editor-ui/src/components/WorkflowHistory/WorkflowHistoryContent.test.ts diff --git a/packages/editor-ui/src/components/WorkflowHistory/__tests__/WorkflowHistoryList.test.ts b/packages/editor-ui/src/components/WorkflowHistory/WorkflowHistoryList.test.ts similarity index 100% rename from packages/editor-ui/src/components/WorkflowHistory/__tests__/WorkflowHistoryList.test.ts rename to packages/editor-ui/src/components/WorkflowHistory/WorkflowHistoryList.test.ts diff --git a/packages/editor-ui/src/components/WorkflowHistory/__tests__/WorkflowHistoryListItem.test.ts b/packages/editor-ui/src/components/WorkflowHistory/WorkflowHistoryListItem.test.ts similarity index 100% rename from packages/editor-ui/src/components/WorkflowHistory/__tests__/WorkflowHistoryListItem.test.ts rename to packages/editor-ui/src/components/WorkflowHistory/WorkflowHistoryListItem.test.ts diff --git a/packages/editor-ui/src/components/__tests__/WorkflowLMChatModal.test.ts b/packages/editor-ui/src/components/WorkflowLMChatModal.test.ts similarity index 100% rename from packages/editor-ui/src/components/__tests__/WorkflowLMChatModal.test.ts rename to packages/editor-ui/src/components/WorkflowLMChatModal.test.ts diff --git a/packages/editor-ui/src/components/__tests__/WorkflowPreview.test.ts b/packages/editor-ui/src/components/WorkflowPreview.test.ts similarity index 100% rename from packages/editor-ui/src/components/__tests__/WorkflowPreview.test.ts rename to packages/editor-ui/src/components/WorkflowPreview.test.ts diff --git a/packages/editor-ui/src/components/__tests__/__snapshots__/ChangePasswordModal.test.ts.snap b/packages/editor-ui/src/components/__snapshots__/ChangePasswordModal.test.ts.snap similarity index 100% rename from packages/editor-ui/src/components/__tests__/__snapshots__/ChangePasswordModal.test.ts.snap rename to packages/editor-ui/src/components/__snapshots__/ChangePasswordModal.test.ts.snap diff --git a/packages/editor-ui/src/components/__tests__/__snapshots__/RunDataJson.test.ts.snap b/packages/editor-ui/src/components/__snapshots__/RunDataJson.test.ts.snap similarity index 100% rename from packages/editor-ui/src/components/__tests__/__snapshots__/RunDataJson.test.ts.snap rename to packages/editor-ui/src/components/__snapshots__/RunDataJson.test.ts.snap diff --git a/packages/editor-ui/src/components/__tests__/__snapshots__/RunDataSchema.test.ts.snap b/packages/editor-ui/src/components/__snapshots__/RunDataSchema.test.ts.snap similarity index 100% rename from packages/editor-ui/src/components/__tests__/__snapshots__/RunDataSchema.test.ts.snap rename to packages/editor-ui/src/components/__snapshots__/RunDataSchema.test.ts.snap diff --git a/packages/editor-ui/src/components/banners/__tests__/V1Banner.spec.ts b/packages/editor-ui/src/components/banners/V1Banner.spec.ts similarity index 96% rename from packages/editor-ui/src/components/banners/__tests__/V1Banner.spec.ts rename to packages/editor-ui/src/components/banners/V1Banner.spec.ts index f01ea4c3f6..9636bbaae6 100644 --- a/packages/editor-ui/src/components/banners/__tests__/V1Banner.spec.ts +++ b/packages/editor-ui/src/components/banners/V1Banner.spec.ts @@ -1,5 +1,5 @@ import { createComponentRenderer } from '@/__tests__/render'; -import V1Banner from '../V1Banner.vue'; +import V1Banner from './V1Banner.vue'; import { createPinia, setActivePinia } from 'pinia'; import { useUsersStore } from '@/stores/users.store'; import { ROLE } from '@/constants'; diff --git a/packages/editor-ui/src/components/banners/__tests__/__snapshots__/V1Banner.spec.ts.snap b/packages/editor-ui/src/components/banners/__snapshots__/V1Banner.spec.ts.snap similarity index 100% rename from packages/editor-ui/src/components/banners/__tests__/__snapshots__/V1Banner.spec.ts.snap rename to packages/editor-ui/src/components/banners/__snapshots__/V1Banner.spec.ts.snap diff --git a/packages/editor-ui/src/composables/__tests__/__snapshots__/useCanvasOperations.spec.ts.snap b/packages/editor-ui/src/composables/__snapshots__/useCanvasOperations.spec.ts.snap similarity index 100% rename from packages/editor-ui/src/composables/__tests__/__snapshots__/useCanvasOperations.spec.ts.snap rename to packages/editor-ui/src/composables/__snapshots__/useCanvasOperations.spec.ts.snap diff --git a/packages/editor-ui/src/composables/__tests__/__snapshots__/useContextMenu.test.ts.snap b/packages/editor-ui/src/composables/__snapshots__/useContextMenu.test.ts.snap similarity index 100% rename from packages/editor-ui/src/composables/__tests__/__snapshots__/useContextMenu.test.ts.snap rename to packages/editor-ui/src/composables/__snapshots__/useContextMenu.test.ts.snap diff --git a/packages/editor-ui/src/composables/__tests__/useAIAssistantHelpers.test.ts b/packages/editor-ui/src/composables/useAIAssistantHelpers.test.ts similarity index 99% rename from packages/editor-ui/src/composables/__tests__/useAIAssistantHelpers.test.ts rename to packages/editor-ui/src/composables/useAIAssistantHelpers.test.ts index d04733336e..d4b01a1374 100644 --- a/packages/editor-ui/src/composables/__tests__/useAIAssistantHelpers.test.ts +++ b/packages/editor-ui/src/composables/useAIAssistantHelpers.test.ts @@ -1,6 +1,6 @@ import { describe, it, expect } from 'vitest'; import type { INode } from 'n8n-workflow'; -import { useAIAssistantHelpers } from '../useAIAssistantHelpers'; +import { useAIAssistantHelpers } from './useAIAssistantHelpers'; import { createTestingPinia } from '@pinia/testing'; import { setActivePinia } from 'pinia'; diff --git a/packages/editor-ui/src/composables/__tests__/useActiveNode.test.ts b/packages/editor-ui/src/composables/useActiveNode.test.ts similarity index 100% rename from packages/editor-ui/src/composables/__tests__/useActiveNode.test.ts rename to packages/editor-ui/src/composables/useActiveNode.test.ts diff --git a/packages/editor-ui/src/composables/__tests__/useAutocompleteTelemetry.test.ts b/packages/editor-ui/src/composables/useAutocompleteTelemetry.test.ts similarity index 97% rename from packages/editor-ui/src/composables/__tests__/useAutocompleteTelemetry.test.ts rename to packages/editor-ui/src/composables/useAutocompleteTelemetry.test.ts index c5625fb33b..17f0289ed9 100644 --- a/packages/editor-ui/src/composables/__tests__/useAutocompleteTelemetry.test.ts +++ b/packages/editor-ui/src/composables/useAutocompleteTelemetry.test.ts @@ -5,7 +5,7 @@ import { createTestingPinia } from '@pinia/testing'; import { waitFor } from '@testing-library/vue'; import { setActivePinia } from 'pinia'; import { beforeEach, describe, vi } from 'vitest'; -import { useAutocompleteTelemetry } from '../useAutocompleteTelemetry'; +import { useAutocompleteTelemetry } from './useAutocompleteTelemetry'; const trackSpy = vi.fn(); const setAutocompleteOnboardedSpy = vi.fn(); diff --git a/packages/editor-ui/src/composables/__tests__/useBeforeUnload.test.ts b/packages/editor-ui/src/composables/useBeforeUnload.test.ts similarity index 100% rename from packages/editor-ui/src/composables/__tests__/useBeforeUnload.test.ts rename to packages/editor-ui/src/composables/useBeforeUnload.test.ts diff --git a/packages/editor-ui/src/composables/__tests__/useCanvasOperations.spec.ts b/packages/editor-ui/src/composables/useCanvasOperations.spec.ts similarity index 100% rename from packages/editor-ui/src/composables/__tests__/useCanvasOperations.spec.ts rename to packages/editor-ui/src/composables/useCanvasOperations.spec.ts diff --git a/packages/editor-ui/src/composables/__tests__/useCanvasPanning.test.ts b/packages/editor-ui/src/composables/useCanvasPanning.test.ts similarity index 100% rename from packages/editor-ui/src/composables/__tests__/useCanvasPanning.test.ts rename to packages/editor-ui/src/composables/useCanvasPanning.test.ts diff --git a/packages/editor-ui/src/composables/__tests__/useClipboard.test.ts b/packages/editor-ui/src/composables/useClipboard.test.ts similarity index 100% rename from packages/editor-ui/src/composables/__tests__/useClipboard.test.ts rename to packages/editor-ui/src/composables/useClipboard.test.ts diff --git a/packages/editor-ui/src/composables/__tests__/useContextMenu.test.ts b/packages/editor-ui/src/composables/useContextMenu.test.ts similarity index 100% rename from packages/editor-ui/src/composables/__tests__/useContextMenu.test.ts rename to packages/editor-ui/src/composables/useContextMenu.test.ts diff --git a/packages/editor-ui/src/composables/__tests__/useDataSchema.test.ts b/packages/editor-ui/src/composables/useDataSchema.test.ts similarity index 100% rename from packages/editor-ui/src/composables/__tests__/useDataSchema.test.ts rename to packages/editor-ui/src/composables/useDataSchema.test.ts diff --git a/packages/editor-ui/src/composables/__tests__/useDebounce.test.ts b/packages/editor-ui/src/composables/useDebounce.test.ts similarity index 97% rename from packages/editor-ui/src/composables/__tests__/useDebounce.test.ts rename to packages/editor-ui/src/composables/useDebounce.test.ts index ea342da77a..729acf1f03 100644 --- a/packages/editor-ui/src/composables/__tests__/useDebounce.test.ts +++ b/packages/editor-ui/src/composables/useDebounce.test.ts @@ -1,5 +1,5 @@ import { vi, describe, it, expect } from 'vitest'; -import { useDebounce } from '../useDebounce'; +import { useDebounce } from './useDebounce'; import { render, screen } from '@testing-library/vue'; describe('useDebounce()', () => { diff --git a/packages/editor-ui/src/composables/__tests__/useDocumentTitle.test.ts b/packages/editor-ui/src/composables/useDocumentTitle.test.ts similarity index 94% rename from packages/editor-ui/src/composables/__tests__/useDocumentTitle.test.ts rename to packages/editor-ui/src/composables/useDocumentTitle.test.ts index 5a88ee570a..a4d8f08417 100644 --- a/packages/editor-ui/src/composables/__tests__/useDocumentTitle.test.ts +++ b/packages/editor-ui/src/composables/useDocumentTitle.test.ts @@ -1,7 +1,7 @@ import { mock } from 'vitest-mock-extended'; import { describe, it, expect } from 'vitest'; import type { FrontendSettings } from '@n8n/api-types'; -import { useDocumentTitle } from '../useDocumentTitle'; +import { useDocumentTitle } from './useDocumentTitle'; const settings = mock({ releaseChannel: 'stable' }); vi.mock('@/stores/settings.store', () => ({ diff --git a/packages/editor-ui/src/composables/__tests__/useExecutionHelpers.test.ts b/packages/editor-ui/src/composables/useExecutionHelpers.test.ts similarity index 100% rename from packages/editor-ui/src/composables/__tests__/useExecutionHelpers.test.ts rename to packages/editor-ui/src/composables/useExecutionHelpers.test.ts diff --git a/packages/editor-ui/src/composables/__tests__/useExpressionEditor.test.ts b/packages/editor-ui/src/composables/useExpressionEditor.test.ts similarity index 99% rename from packages/editor-ui/src/composables/__tests__/useExpressionEditor.test.ts rename to packages/editor-ui/src/composables/useExpressionEditor.test.ts index 958946d2ad..d6ed9338c5 100644 --- a/packages/editor-ui/src/composables/__tests__/useExpressionEditor.test.ts +++ b/packages/editor-ui/src/composables/useExpressionEditor.test.ts @@ -6,7 +6,7 @@ import { setActivePinia } from 'pinia'; import { beforeEach, describe, vi } from 'vitest'; import { defineComponent, h, ref, toValue } from 'vue'; import { n8nLang } from '@/plugins/codemirror/n8nLang'; -import { useExpressionEditor } from '../useExpressionEditor'; +import { useExpressionEditor } from './useExpressionEditor'; import { useRouter } from 'vue-router'; import { EditorSelection } from '@codemirror/state'; import userEvent from '@testing-library/user-event'; diff --git a/packages/editor-ui/src/composables/__tests__/useHistoryHelper.test.ts b/packages/editor-ui/src/composables/useHistoryHelper.test.ts similarity index 97% rename from packages/editor-ui/src/composables/__tests__/useHistoryHelper.test.ts rename to packages/editor-ui/src/composables/useHistoryHelper.test.ts index 494554f68d..6b6848649d 100644 --- a/packages/editor-ui/src/composables/__tests__/useHistoryHelper.test.ts +++ b/packages/editor-ui/src/composables/useHistoryHelper.test.ts @@ -2,7 +2,7 @@ import { vi, describe, it, expect } from 'vitest'; import { MAIN_HEADER_TABS } from '@/constants'; import { render } from '@testing-library/vue'; import userEvent from '@testing-library/user-event'; -import { useHistoryHelper } from '../useHistoryHelper'; +import { useHistoryHelper } from './useHistoryHelper'; import { defineComponent, type PropType } from 'vue'; import type { RouteLocationNormalizedLoaded } from 'vue-router'; import { mock } from 'vitest-mock-extended'; diff --git a/packages/editor-ui/src/composables/__tests__/useKeybindings.test.ts b/packages/editor-ui/src/composables/useKeybindings.test.ts similarity index 98% rename from packages/editor-ui/src/composables/__tests__/useKeybindings.test.ts rename to packages/editor-ui/src/composables/useKeybindings.test.ts index 54c042c79a..b380b3a91e 100644 --- a/packages/editor-ui/src/composables/__tests__/useKeybindings.test.ts +++ b/packages/editor-ui/src/composables/useKeybindings.test.ts @@ -2,7 +2,7 @@ import { renderComponent } from '@/__tests__/render'; import userEvent from '@testing-library/user-event'; import { describe, expect, it, vi } from 'vitest'; import { defineComponent, h, ref } from 'vue'; -import { useKeybindings } from '../useKeybindings'; +import { useKeybindings } from './useKeybindings'; const renderTestComponent = async (...args: Parameters) => { return renderComponent( diff --git a/packages/editor-ui/src/composables/__tests__/useNodeBase.spec.ts b/packages/editor-ui/src/composables/useNodeBase.spec.ts similarity index 100% rename from packages/editor-ui/src/composables/__tests__/useNodeBase.spec.ts rename to packages/editor-ui/src/composables/useNodeBase.spec.ts diff --git a/packages/editor-ui/src/composables/__tests__/useNodeConnections.spec.ts b/packages/editor-ui/src/composables/useNodeConnections.spec.ts similarity index 100% rename from packages/editor-ui/src/composables/__tests__/useNodeConnections.spec.ts rename to packages/editor-ui/src/composables/useNodeConnections.spec.ts diff --git a/packages/editor-ui/src/composables/__tests__/useNodeHelpers.test.ts b/packages/editor-ui/src/composables/useNodeHelpers.test.ts similarity index 100% rename from packages/editor-ui/src/composables/__tests__/useNodeHelpers.test.ts rename to packages/editor-ui/src/composables/useNodeHelpers.test.ts diff --git a/packages/editor-ui/src/composables/__tests__/useNodeType.test.ts b/packages/editor-ui/src/composables/useNodeType.test.ts similarity index 100% rename from packages/editor-ui/src/composables/__tests__/useNodeType.test.ts rename to packages/editor-ui/src/composables/useNodeType.test.ts diff --git a/packages/editor-ui/src/composables/__tests__/usePageRedirectionHelper.test.ts b/packages/editor-ui/src/composables/usePageRedirectionHelper.test.ts similarity index 97% rename from packages/editor-ui/src/composables/__tests__/usePageRedirectionHelper.test.ts rename to packages/editor-ui/src/composables/usePageRedirectionHelper.test.ts index ee080531de..246ac9f9fe 100644 --- a/packages/editor-ui/src/composables/__tests__/usePageRedirectionHelper.test.ts +++ b/packages/editor-ui/src/composables/usePageRedirectionHelper.test.ts @@ -1,13 +1,13 @@ import { ROLE } from '@/constants'; import { useSettingsStore } from '@/stores/settings.store'; import { merge } from 'lodash-es'; -import { usePageRedirectionHelper } from '../usePageRedirectionHelper'; +import { usePageRedirectionHelper } from './usePageRedirectionHelper'; import { defaultSettings } from '@/__tests__/defaults'; import { useUsersStore } from '@/stores/users.store'; import { createPinia, setActivePinia } from 'pinia'; import * as cloudPlanApi from '@/api/cloudPlans'; import { useVersionsStore } from '@/stores/versions.store'; -import { useTelemetry } from '../useTelemetry'; +import { useTelemetry } from './useTelemetry'; let settingsStore: ReturnType; let usersStore: ReturnType; diff --git a/packages/editor-ui/src/composables/__tests__/usePinnedData.test.ts b/packages/editor-ui/src/composables/usePinnedData.test.ts similarity index 100% rename from packages/editor-ui/src/composables/__tests__/usePinnedData.test.ts rename to packages/editor-ui/src/composables/usePinnedData.test.ts diff --git a/packages/editor-ui/src/composables/__tests__/usePushConnection.spec.ts b/packages/editor-ui/src/composables/usePushConnection.spec.ts similarity index 100% rename from packages/editor-ui/src/composables/__tests__/usePushConnection.spec.ts rename to packages/editor-ui/src/composables/usePushConnection.spec.ts diff --git a/packages/editor-ui/src/composables/__tests__/useRunWorkflow.spec.ts b/packages/editor-ui/src/composables/useRunWorkflow.spec.ts similarity index 100% rename from packages/editor-ui/src/composables/__tests__/useRunWorkflow.spec.ts rename to packages/editor-ui/src/composables/useRunWorkflow.spec.ts diff --git a/packages/editor-ui/src/composables/__tests__/useUniqueNodeName.test.ts b/packages/editor-ui/src/composables/useUniqueNodeName.test.ts similarity index 100% rename from packages/editor-ui/src/composables/__tests__/useUniqueNodeName.test.ts rename to packages/editor-ui/src/composables/useUniqueNodeName.test.ts diff --git a/packages/editor-ui/src/composables/__tests__/useWorkflowHelpers.spec.ts b/packages/editor-ui/src/composables/useWorkflowHelpers.spec.ts similarity index 100% rename from packages/editor-ui/src/composables/__tests__/useWorkflowHelpers.spec.ts rename to packages/editor-ui/src/composables/useWorkflowHelpers.spec.ts diff --git a/packages/editor-ui/src/__tests__/init.test.ts b/packages/editor-ui/src/init.test.ts similarity index 100% rename from packages/editor-ui/src/__tests__/init.test.ts rename to packages/editor-ui/src/init.test.ts diff --git a/packages/editor-ui/src/mixins/__tests__/workflowHelpers.spec.ts b/packages/editor-ui/src/mixins/workflowHelpers.spec.ts similarity index 100% rename from packages/editor-ui/src/mixins/__tests__/workflowHelpers.spec.ts rename to packages/editor-ui/src/mixins/workflowHelpers.spec.ts diff --git a/packages/editor-ui/src/plugins/codemirror/completions/__tests__/base.completions.test.ts b/packages/editor-ui/src/plugins/codemirror/completions/base.completions.test.ts similarity index 99% rename from packages/editor-ui/src/plugins/codemirror/completions/__tests__/base.completions.test.ts rename to packages/editor-ui/src/plugins/codemirror/completions/base.completions.test.ts index b2436bfd48..fa38f072c4 100644 --- a/packages/editor-ui/src/plugins/codemirror/completions/__tests__/base.completions.test.ts +++ b/packages/editor-ui/src/plugins/codemirror/completions/base.completions.test.ts @@ -14,7 +14,7 @@ import type { CompletionSource, CompletionResult } from '@codemirror/autocomplet import { CompletionContext } from '@codemirror/autocomplete'; import { EditorState } from '@codemirror/state'; import { n8nLang } from '@/plugins/codemirror/n8nLang'; -import { LUXON_RECOMMENDED_OPTIONS, STRING_RECOMMENDED_OPTIONS } from '../constants'; +import { LUXON_RECOMMENDED_OPTIONS, STRING_RECOMMENDED_OPTIONS } from './constants'; import { uniqBy } from 'lodash-es'; beforeEach(async () => { diff --git a/packages/editor-ui/src/plugins/codemirror/completions/__tests__/completions.test.ts b/packages/editor-ui/src/plugins/codemirror/completions/completions.test.ts similarity index 99% rename from packages/editor-ui/src/plugins/codemirror/completions/__tests__/completions.test.ts rename to packages/editor-ui/src/plugins/codemirror/completions/completions.test.ts index bed05f2c31..8a10db1395 100644 --- a/packages/editor-ui/src/plugins/codemirror/completions/__tests__/completions.test.ts +++ b/packages/editor-ui/src/plugins/codemirror/completions/completions.test.ts @@ -12,7 +12,7 @@ import { natives, } from '@/plugins/codemirror/completions/datatype.completions'; -import { mockProxy } from './mock'; +import { mockProxy } from './__tests__/mock'; import type { CompletionSource, CompletionResult } from '@codemirror/autocomplete'; import { CompletionContext } from '@codemirror/autocomplete'; import { EditorState } from '@codemirror/state'; @@ -28,7 +28,7 @@ import { METHODS_SECTION, RECOMMENDED_SECTION, STRING_RECOMMENDED_OPTIONS, -} from '../constants'; +} from './constants'; import { set, uniqBy } from 'lodash-es'; import { mockNodes } from '@/__tests__/mocks'; diff --git a/packages/editor-ui/src/plugins/codemirror/completions/__tests__/itemField.completions.test.ts b/packages/editor-ui/src/plugins/codemirror/completions/itemField.completions.test.ts similarity index 100% rename from packages/editor-ui/src/plugins/codemirror/completions/__tests__/itemField.completions.test.ts rename to packages/editor-ui/src/plugins/codemirror/completions/itemField.completions.test.ts diff --git a/packages/editor-ui/src/plugins/codemirror/completions/__tests__/itemIndex.completions.test.ts b/packages/editor-ui/src/plugins/codemirror/completions/itemIndex.completions.test.ts similarity index 100% rename from packages/editor-ui/src/plugins/codemirror/completions/__tests__/itemIndex.completions.test.ts rename to packages/editor-ui/src/plugins/codemirror/completions/itemIndex.completions.test.ts diff --git a/packages/editor-ui/src/plugins/codemirror/completions/__tests__/jsonField.completions.test.ts b/packages/editor-ui/src/plugins/codemirror/completions/jsonField.completions.test.ts similarity index 100% rename from packages/editor-ui/src/plugins/codemirror/completions/__tests__/jsonField.completions.test.ts rename to packages/editor-ui/src/plugins/codemirror/completions/jsonField.completions.test.ts diff --git a/packages/editor-ui/src/plugins/codemirror/completions/__tests__/prevNode.completions.test.ts b/packages/editor-ui/src/plugins/codemirror/completions/prevNode.completions.test.ts similarity index 100% rename from packages/editor-ui/src/plugins/codemirror/completions/__tests__/prevNode.completions.test.ts rename to packages/editor-ui/src/plugins/codemirror/completions/prevNode.completions.test.ts diff --git a/packages/editor-ui/src/plugins/codemirror/completions/__tests__/require.completions.test.ts b/packages/editor-ui/src/plugins/codemirror/completions/require.completions.test.ts similarity index 100% rename from packages/editor-ui/src/plugins/codemirror/completions/__tests__/require.completions.test.ts rename to packages/editor-ui/src/plugins/codemirror/completions/require.completions.test.ts diff --git a/packages/editor-ui/src/plugins/codemirror/completions/__tests__/utils.test.ts b/packages/editor-ui/src/plugins/codemirror/completions/utils.test.ts similarity index 99% rename from packages/editor-ui/src/plugins/codemirror/completions/__tests__/utils.test.ts rename to packages/editor-ui/src/plugins/codemirror/completions/utils.test.ts index 7fb6e8ea8b..9d1da3ad52 100644 --- a/packages/editor-ui/src/plugins/codemirror/completions/__tests__/utils.test.ts +++ b/packages/editor-ui/src/plugins/codemirror/completions/utils.test.ts @@ -1,7 +1,7 @@ import { createTestNode, createTestWorkflowObject } from '@/__tests__/mocks'; import * as workflowHelpers from '@/composables/useWorkflowHelpers'; import { javascriptLanguage } from '@codemirror/lang-javascript'; -import { autocompletableNodeNames, expressionWithFirstItem } from '../utils'; +import { autocompletableNodeNames, expressionWithFirstItem } from './utils'; import type { MockInstance } from 'vitest'; import * as ndvStore from '@/stores/ndv.store'; import { NodeConnectionType, type IConnections } from 'n8n-workflow'; diff --git a/packages/editor-ui/src/plugins/codemirror/completions/__tests__/variables.completions.test.ts b/packages/editor-ui/src/plugins/codemirror/completions/variables.completions.test.ts similarity index 100% rename from packages/editor-ui/src/plugins/codemirror/completions/__tests__/variables.completions.test.ts rename to packages/editor-ui/src/plugins/codemirror/completions/variables.completions.test.ts diff --git a/packages/editor-ui/src/plugins/codemirror/__tests__/dragAndDrop.test.ts b/packages/editor-ui/src/plugins/codemirror/dragAndDrop.test.ts similarity index 95% rename from packages/editor-ui/src/plugins/codemirror/__tests__/dragAndDrop.test.ts rename to packages/editor-ui/src/plugins/codemirror/dragAndDrop.test.ts index 512cc49109..0e2a51150c 100644 --- a/packages/editor-ui/src/plugins/codemirror/__tests__/dragAndDrop.test.ts +++ b/packages/editor-ui/src/plugins/codemirror/dragAndDrop.test.ts @@ -4,8 +4,8 @@ import { EditorView } from '@codemirror/view'; import { createTestingPinia } from '@pinia/testing'; import { fireEvent } from '@testing-library/dom'; import { setActivePinia } from 'pinia'; -import { mappingDropCursor } from '../dragAndDrop'; -import { n8nLang } from '../n8nLang'; +import { mappingDropCursor } from './dragAndDrop'; +import { n8nLang } from './n8nLang'; describe('CodeMirror drag and drop', () => { beforeEach(() => { diff --git a/packages/editor-ui/src/plugins/codemirror/tooltips/__tests__/infoBoxTooltip.test.ts b/packages/editor-ui/src/plugins/codemirror/tooltips/infoBoxTooltip.test.ts similarity index 98% rename from packages/editor-ui/src/plugins/codemirror/tooltips/__tests__/infoBoxTooltip.test.ts rename to packages/editor-ui/src/plugins/codemirror/tooltips/infoBoxTooltip.test.ts index 8a5cb32fe2..d248cb1ac4 100644 --- a/packages/editor-ui/src/plugins/codemirror/tooltips/__tests__/infoBoxTooltip.test.ts +++ b/packages/editor-ui/src/plugins/codemirror/tooltips/infoBoxTooltip.test.ts @@ -3,7 +3,7 @@ import { EditorView, getTooltip, showTooltip, type Tooltip } from '@codemirror/v import { createTestingPinia } from '@pinia/testing'; import { setActivePinia } from 'pinia'; import { n8nLang } from '@/plugins/codemirror/n8nLang'; -import { hoverTooltipSource, infoBoxTooltips } from '../InfoBoxTooltip'; +import { hoverTooltipSource, infoBoxTooltips } from './InfoBoxTooltip'; import * as utils from '@/plugins/codemirror/completions/utils'; import * as workflowHelpers from '@/composables/useWorkflowHelpers'; diff --git a/packages/editor-ui/src/plugins/__tests__/telemetry.test.ts b/packages/editor-ui/src/plugins/telemetry.test.ts similarity index 100% rename from packages/editor-ui/src/plugins/__tests__/telemetry.test.ts rename to packages/editor-ui/src/plugins/telemetry.test.ts diff --git a/packages/editor-ui/src/__tests__/router.test.ts b/packages/editor-ui/src/router.test.ts similarity index 100% rename from packages/editor-ui/src/__tests__/router.test.ts rename to packages/editor-ui/src/router.test.ts diff --git a/packages/editor-ui/src/stores/__tests__/assistant.store.test.ts b/packages/editor-ui/src/stores/assistant.store.test.ts similarity index 99% rename from packages/editor-ui/src/stores/__tests__/assistant.store.test.ts rename to packages/editor-ui/src/stores/assistant.store.test.ts index a4685e9e8d..c5877a0648 100644 --- a/packages/editor-ui/src/stores/__tests__/assistant.store.test.ts +++ b/packages/editor-ui/src/stores/assistant.store.test.ts @@ -8,9 +8,9 @@ import { useAssistantStore, } from '@/stores/assistant.store'; import type { ChatRequest } from '@/types/assistant.types'; -import { usePostHog } from '../posthog.store'; +import { usePostHog } from './posthog.store'; import { useSettingsStore } from '@/stores/settings.store'; -import { defaultSettings } from '../../__tests__/defaults'; +import { defaultSettings } from '../__tests__/defaults'; import { merge } from 'lodash-es'; import { DEFAULT_POSTHOG_SETTINGS } from './posthog.test'; import { AI_ASSISTANT_EXPERIMENT, VIEWS } from '@/constants'; diff --git a/packages/editor-ui/src/stores/__tests__/credentials.spec.ts b/packages/editor-ui/src/stores/credentials.spec.ts similarity index 100% rename from packages/editor-ui/src/stores/__tests__/credentials.spec.ts rename to packages/editor-ui/src/stores/credentials.spec.ts diff --git a/packages/editor-ui/src/stores/__tests__/environments.spec.ts b/packages/editor-ui/src/stores/environments.spec.ts similarity index 100% rename from packages/editor-ui/src/stores/__tests__/environments.spec.ts rename to packages/editor-ui/src/stores/environments.spec.ts diff --git a/packages/editor-ui/src/stores/__tests__/posthog.test.ts b/packages/editor-ui/src/stores/posthog.test.ts similarity index 98% rename from packages/editor-ui/src/stores/__tests__/posthog.test.ts rename to packages/editor-ui/src/stores/posthog.test.ts index e2a5dd9d67..745d1ca7e1 100644 --- a/packages/editor-ui/src/stores/__tests__/posthog.test.ts +++ b/packages/editor-ui/src/stores/posthog.test.ts @@ -6,7 +6,7 @@ import { useRootStore } from '@/stores/root.store'; import type { FrontendSettings } from '@n8n/api-types'; import { LOCAL_STORAGE_EXPERIMENT_OVERRIDES } from '@/constants'; import { nextTick } from 'vue'; -import { defaultSettings } from '../../__tests__/defaults'; +import { defaultSettings } from '../__tests__/defaults'; import { useTelemetry } from '@/composables/useTelemetry'; export const DEFAULT_POSTHOG_SETTINGS: FrontendSettings['posthog'] = { diff --git a/packages/editor-ui/src/stores/__tests__/rbac.store.test.ts b/packages/editor-ui/src/stores/rbac.store.test.ts similarity index 100% rename from packages/editor-ui/src/stores/__tests__/rbac.store.test.ts rename to packages/editor-ui/src/stores/rbac.store.test.ts diff --git a/packages/editor-ui/src/stores/__tests__/sso.test.ts b/packages/editor-ui/src/stores/sso.test.ts similarity index 100% rename from packages/editor-ui/src/stores/__tests__/sso.test.ts rename to packages/editor-ui/src/stores/sso.test.ts diff --git a/packages/editor-ui/src/stores/__tests__/ui.test.ts b/packages/editor-ui/src/stores/ui.test.ts similarity index 97% rename from packages/editor-ui/src/stores/__tests__/ui.test.ts rename to packages/editor-ui/src/stores/ui.test.ts index 7de20d2502..ea937abb6e 100644 --- a/packages/editor-ui/src/stores/__tests__/ui.test.ts +++ b/packages/editor-ui/src/stores/ui.test.ts @@ -5,13 +5,13 @@ import { useUsersStore } from '@/stores/users.store'; import { merge } from 'lodash-es'; import { useCloudPlanStore } from '@/stores/cloudPlan.store'; import * as cloudPlanApi from '@/api/cloudPlans'; -import { defaultSettings } from '../../__tests__/defaults'; +import { defaultSettings } from '../__tests__/defaults'; import { getTrialExpiredUserResponse, getTrialingUserResponse, getUserCloudInfo, getNotTrialingUserResponse, -} from './utils/cloudStoreUtils'; +} from './__tests__/utils/cloudStoreUtils'; import type { IRole } from '@/Interface'; import { ROLE } from '@/constants'; diff --git a/packages/editor-ui/src/stores/__tests__/usage.test.ts b/packages/editor-ui/src/stores/usage.test.ts similarity index 100% rename from packages/editor-ui/src/stores/__tests__/usage.test.ts rename to packages/editor-ui/src/stores/usage.test.ts diff --git a/packages/editor-ui/src/stores/__tests__/workflowHistory.store.test.ts b/packages/editor-ui/src/stores/workflowHistory.store.test.ts similarity index 100% rename from packages/editor-ui/src/stores/__tests__/workflowHistory.store.test.ts rename to packages/editor-ui/src/stores/workflowHistory.store.test.ts diff --git a/packages/editor-ui/src/utils/__tests__/apiUtils.spec.ts b/packages/editor-ui/src/utils/apiUtils.spec.ts similarity index 97% rename from packages/editor-ui/src/utils/__tests__/apiUtils.spec.ts rename to packages/editor-ui/src/utils/apiUtils.spec.ts index cefb6f3389..f6be9036b2 100644 --- a/packages/editor-ui/src/utils/__tests__/apiUtils.spec.ts +++ b/packages/editor-ui/src/utils/apiUtils.spec.ts @@ -1,4 +1,4 @@ -import { STREAM_SEPERATOR, streamRequest } from '../apiUtils'; +import { STREAM_SEPERATOR, streamRequest } from './apiUtils'; describe('streamRequest', () => { it('should stream data from the API endpoint', async () => { diff --git a/packages/editor-ui/src/utils/__tests__/canvasUtilsV2.spec.ts b/packages/editor-ui/src/utils/canvasUtilsV2.spec.ts similarity index 100% rename from packages/editor-ui/src/utils/__tests__/canvasUtilsV2.spec.ts rename to packages/editor-ui/src/utils/canvasUtilsV2.spec.ts diff --git a/packages/editor-ui/src/utils/__tests__/executionUtils.spec.ts b/packages/editor-ui/src/utils/executionUtils.spec.ts similarity index 95% rename from packages/editor-ui/src/utils/__tests__/executionUtils.spec.ts rename to packages/editor-ui/src/utils/executionUtils.spec.ts index e1748a5bc0..524a24a63c 100644 --- a/packages/editor-ui/src/utils/__tests__/executionUtils.spec.ts +++ b/packages/editor-ui/src/utils/executionUtils.spec.ts @@ -1,12 +1,12 @@ import { describe, it, expect, vi, beforeEach } from 'vitest'; -import { displayForm, openPopUpWindow, executionFilterToQueryFilter } from '../executionUtils'; +import { displayForm, openPopUpWindow, executionFilterToQueryFilter } from './executionUtils'; import type { INode, IRunData, IPinData } from 'n8n-workflow'; const FORM_TRIGGER_NODE_TYPE = 'formTrigger'; const WAIT_NODE_TYPE = 'waitNode'; -vi.mock('../executionUtils', async () => { - const actual = await vi.importActual('../executionUtils'); +vi.mock('./executionUtils', async () => { + const actual = await vi.importActual('./executionUtils'); return { ...actual, openPopUpWindow: vi.fn(), diff --git a/packages/editor-ui/src/utils/__tests__/expressions.test.ts b/packages/editor-ui/src/utils/expressions.test.ts similarity index 94% rename from packages/editor-ui/src/utils/__tests__/expressions.test.ts rename to packages/editor-ui/src/utils/expressions.test.ts index c467dc59f5..b2b11728c5 100644 --- a/packages/editor-ui/src/utils/__tests__/expressions.test.ts +++ b/packages/editor-ui/src/utils/expressions.test.ts @@ -1,9 +1,5 @@ import { ExpressionError } from 'n8n-workflow'; -import { - removeExpressionPrefix, - stringifyExpressionResult, - unwrapExpression, -} from '../expressions'; +import { removeExpressionPrefix, stringifyExpressionResult, unwrapExpression } from './expressions'; describe('Utils: Expressions', () => { describe('stringifyExpressionResult()', () => { diff --git a/packages/editor-ui/src/utils/__tests__/htmlUtils.spec.ts b/packages/editor-ui/src/utils/htmlUtils.spec.ts similarity index 97% rename from packages/editor-ui/src/utils/__tests__/htmlUtils.spec.ts rename to packages/editor-ui/src/utils/htmlUtils.spec.ts index 6032c02420..1b1b5f04f8 100644 --- a/packages/editor-ui/src/utils/__tests__/htmlUtils.spec.ts +++ b/packages/editor-ui/src/utils/htmlUtils.spec.ts @@ -1,5 +1,5 @@ import { ALLOWED_HTML_TAGS } from '@/constants'; -import { sanitizeHtml } from '../htmlUtils'; +import { sanitizeHtml } from './htmlUtils'; describe('sanitizeHtml', () => { test.each(ALLOWED_HTML_TAGS)('should allow allowed HTML tag %s', (tag) => { diff --git a/packages/editor-ui/src/utils/__tests__/mappingUtils.test.ts b/packages/editor-ui/src/utils/mappingUtils.test.ts similarity index 99% rename from packages/editor-ui/src/utils/__tests__/mappingUtils.test.ts rename to packages/editor-ui/src/utils/mappingUtils.test.ts index 797c512768..eb41dfd122 100644 --- a/packages/editor-ui/src/utils/__tests__/mappingUtils.test.ts +++ b/packages/editor-ui/src/utils/mappingUtils.test.ts @@ -4,7 +4,7 @@ import { getMappedExpression, escapeMappingString, propertyNameFromExpression, -} from '../mappingUtils'; +} from './mappingUtils'; const RLC_PARAM: INodeProperties = { displayName: 'Base', diff --git a/packages/editor-ui/src/utils/__tests__/nodeViewUtils.spec.ts b/packages/editor-ui/src/utils/nodeViewUtils.spec.ts similarity index 98% rename from packages/editor-ui/src/utils/__tests__/nodeViewUtils.spec.ts rename to packages/editor-ui/src/utils/nodeViewUtils.spec.ts index 2ad737f198..09c8a46366 100644 --- a/packages/editor-ui/src/utils/__tests__/nodeViewUtils.spec.ts +++ b/packages/editor-ui/src/utils/nodeViewUtils.spec.ts @@ -1,4 +1,4 @@ -import { generateOffsets, getGenericHints } from '../nodeViewUtils'; +import { generateOffsets, getGenericHints } from './nodeViewUtils'; import type { INode, INodeTypeDescription, INodeExecutionData, Workflow } from 'n8n-workflow'; import type { INodeUi } from '@/Interface'; import { NodeHelpers } from 'n8n-workflow'; diff --git a/packages/editor-ui/src/utils/__tests__/objectUtils.test.ts b/packages/editor-ui/src/utils/objectUtils.test.ts similarity index 100% rename from packages/editor-ui/src/utils/__tests__/objectUtils.test.ts rename to packages/editor-ui/src/utils/objectUtils.test.ts diff --git a/packages/editor-ui/src/utils/__tests__/pairedItemUtils.test.ts b/packages/editor-ui/src/utils/pairedItemUtils.test.ts similarity index 99% rename from packages/editor-ui/src/utils/__tests__/pairedItemUtils.test.ts rename to packages/editor-ui/src/utils/pairedItemUtils.test.ts index 6d41511c70..e3e2835bb0 100644 --- a/packages/editor-ui/src/utils/__tests__/pairedItemUtils.test.ts +++ b/packages/editor-ui/src/utils/pairedItemUtils.test.ts @@ -4,7 +4,7 @@ import { getSourceItems, getPairedItemsMapping, MAX_ITEM_COUNT_FOR_PAIRING, -} from '../pairedItemUtils'; +} from './pairedItemUtils'; const MOCK_EXECUTION: Partial = { data: { diff --git a/packages/editor-ui/src/utils/__tests__/rbacUtils.test.ts b/packages/editor-ui/src/utils/rbacUtils.test.ts similarity index 100% rename from packages/editor-ui/src/utils/__tests__/rbacUtils.test.ts rename to packages/editor-ui/src/utils/rbacUtils.test.ts diff --git a/packages/editor-ui/src/utils/templates/__tests__/templateActions.test.ts b/packages/editor-ui/src/utils/templates/templateActions.test.ts similarity index 100% rename from packages/editor-ui/src/utils/templates/__tests__/templateActions.test.ts rename to packages/editor-ui/src/utils/templates/templateActions.test.ts diff --git a/packages/editor-ui/src/utils/templates/__tests__/templateTransforms.test.ts b/packages/editor-ui/src/utils/templates/templateTransforms.test.ts similarity index 100% rename from packages/editor-ui/src/utils/templates/__tests__/templateTransforms.test.ts rename to packages/editor-ui/src/utils/templates/templateTransforms.test.ts diff --git a/packages/editor-ui/src/utils/__tests__/typesUtils.test.ts b/packages/editor-ui/src/utils/typesUtils.test.ts similarity index 100% rename from packages/editor-ui/src/utils/__tests__/typesUtils.test.ts rename to packages/editor-ui/src/utils/typesUtils.test.ts diff --git a/packages/editor-ui/src/views/__tests__/AuthView.test.ts b/packages/editor-ui/src/views/AuthView.test.ts similarity index 100% rename from packages/editor-ui/src/views/__tests__/AuthView.test.ts rename to packages/editor-ui/src/views/AuthView.test.ts diff --git a/packages/editor-ui/src/views/__tests__/SamlOnboarding.test.ts b/packages/editor-ui/src/views/SamlOnboarding.test.ts similarity index 100% rename from packages/editor-ui/src/views/__tests__/SamlOnboarding.test.ts rename to packages/editor-ui/src/views/SamlOnboarding.test.ts diff --git a/packages/editor-ui/src/views/__tests__/SettingsExternalSecrets.test.ts b/packages/editor-ui/src/views/SettingsExternalSecrets.test.ts similarity index 100% rename from packages/editor-ui/src/views/__tests__/SettingsExternalSecrets.test.ts rename to packages/editor-ui/src/views/SettingsExternalSecrets.test.ts diff --git a/packages/editor-ui/src/views/__tests__/SettingsPersonalView.test.ts b/packages/editor-ui/src/views/SettingsPersonalView.test.ts similarity index 100% rename from packages/editor-ui/src/views/__tests__/SettingsPersonalView.test.ts rename to packages/editor-ui/src/views/SettingsPersonalView.test.ts diff --git a/packages/editor-ui/src/views/SettingsSso.test.ts b/packages/editor-ui/src/views/SettingsSso.test.ts index 0306bde35f..f42160f5ee 100644 --- a/packages/editor-ui/src/views/SettingsSso.test.ts +++ b/packages/editor-ui/src/views/SettingsSso.test.ts @@ -1,10 +1,15 @@ import { createTestingPinia } from '@pinia/testing'; -import { createComponentRenderer } from '@/__tests__/render'; -import SettingsSso from './SettingsSso.vue'; -import { useSSOStore } from '@/stores/sso.store'; import { within, waitFor } from '@testing-library/vue'; +import { mockedStore, retry } from '@/__tests__/utils'; +import { createPinia, setActivePinia } from 'pinia'; +import SettingsSso from '@/views/SettingsSso.vue'; +import { setupServer } from '@/__tests__/server'; +import { useSettingsStore } from '@/stores/settings.store'; import userEvent from '@testing-library/user-event'; -import { mockedStore } from '@/__tests__/utils'; +import { useSSOStore } from '@/stores/sso.store'; +import { createComponentRenderer } from '@/__tests__/render'; +import { EnterpriseEditionFeature } from '@/constants'; +import { nextTick } from 'vue'; import { usePageRedirectionHelper } from '@/composables/usePageRedirectionHelper'; const renderView = createComponentRenderer(SettingsSso); @@ -210,3 +215,81 @@ describe('SettingsSso View', () => { }); }); }); + +let pinia: ReturnType; +let ssoStore: ReturnType; +let settingsStore: ReturnType; +let server: ReturnType; + +const renderComponent = createComponentRenderer(SettingsSso); + +describe('SettingsSso', () => { + beforeAll(() => { + server = setupServer(); + }); + + beforeEach(async () => { + window.open = vi.fn(); + + pinia = createPinia(); + setActivePinia(pinia); + + ssoStore = useSSOStore(); + settingsStore = useSettingsStore(); + + await settingsStore.getSettings(); + }); + + afterEach(() => { + vi.clearAllMocks(); + }); + + afterAll(() => { + server.shutdown(); + }); + + it('should render paywall state when there is no license', () => { + const { getByTestId, queryByTestId, queryByRole } = renderComponent({ + pinia, + }); + + expect(queryByRole('checkbox')).not.toBeInTheDocument(); + expect(queryByTestId('sso-content-licensed')).not.toBeInTheDocument(); + expect(getByTestId('sso-content-unlicensed')).toBeInTheDocument(); + }); + + it('should render licensed content', async () => { + settingsStore.settings.enterprise[EnterpriseEditionFeature.Saml] = true; + await nextTick(); + + const { getByTestId, queryByTestId, getByRole } = renderComponent({ + pinia, + }); + + expect(getByRole('switch')).toBeInTheDocument(); + expect(getByTestId('sso-content-licensed')).toBeInTheDocument(); + expect(queryByTestId('sso-content-unlicensed')).not.toBeInTheDocument(); + }); + + it('should enable activation checkbox and test button if data is already saved', async () => { + await ssoStore.getSamlConfig(); + settingsStore.settings.enterprise[EnterpriseEditionFeature.Saml] = true; + await nextTick(); + + const { container, getByTestId, getByRole } = renderComponent({ + pinia, + }); + + const xmlRadioButton = getByTestId('radio-button-xml'); + await userEvent.click(xmlRadioButton); + + await retry(() => + expect(container.querySelector('textarea[name="metadata"]')).toHaveValue( + '', + ), + ); + + expect(getByRole('switch')).toBeEnabled(); + expect(getByTestId('sso-test')).toBeEnabled(); + }); +}); diff --git a/packages/editor-ui/src/views/SetupWorkflowFromTemplateView/__tests__/setupTemplate.store.test.ts b/packages/editor-ui/src/views/SetupWorkflowFromTemplateView/setupTemplate.store.test.ts similarity index 99% rename from packages/editor-ui/src/views/SetupWorkflowFromTemplateView/__tests__/setupTemplate.store.test.ts rename to packages/editor-ui/src/views/SetupWorkflowFromTemplateView/setupTemplate.store.test.ts index 8a30bd8898..ed30289602 100644 --- a/packages/editor-ui/src/views/SetupWorkflowFromTemplateView/__tests__/setupTemplate.store.test.ts +++ b/packages/editor-ui/src/views/SetupWorkflowFromTemplateView/setupTemplate.store.test.ts @@ -21,7 +21,7 @@ import { nodeTypeTelegram, nodeTypeTwitter, } from '@/utils/testData/nodeTypeTestData'; -import * as testData from './setupTemplate.store.testData'; +import * as testData from './__tests__/setupTemplate.store.testData'; const mockCredentialsResponse = (id: string) => mock({ diff --git a/packages/editor-ui/src/views/SetupWorkflowFromTemplateView/__tests__/useCredentialSetupState.test.ts b/packages/editor-ui/src/views/SetupWorkflowFromTemplateView/useCredentialSetupState.test.ts similarity index 100% rename from packages/editor-ui/src/views/SetupWorkflowFromTemplateView/__tests__/useCredentialSetupState.test.ts rename to packages/editor-ui/src/views/SetupWorkflowFromTemplateView/useCredentialSetupState.test.ts diff --git a/packages/editor-ui/src/views/__tests__/WorkflowHistory.test.ts b/packages/editor-ui/src/views/WorkflowHistory.test.ts similarity index 100% rename from packages/editor-ui/src/views/__tests__/WorkflowHistory.test.ts rename to packages/editor-ui/src/views/WorkflowHistory.test.ts diff --git a/packages/editor-ui/src/views/__tests__/SettingsSso.test.ts b/packages/editor-ui/src/views/__tests__/SettingsSso.test.ts deleted file mode 100644 index c77421335d..0000000000 --- a/packages/editor-ui/src/views/__tests__/SettingsSso.test.ts +++ /dev/null @@ -1,90 +0,0 @@ -import { createPinia, setActivePinia } from 'pinia'; -import SettingsSso from '@/views/SettingsSso.vue'; - -import { retry } from '@/__tests__/utils'; -import { setupServer } from '@/__tests__/server'; -import { afterAll, beforeAll } from 'vitest'; -import { useSettingsStore } from '@/stores/settings.store'; -import userEvent from '@testing-library/user-event'; -import { useSSOStore } from '@/stores/sso.store'; -import { createComponentRenderer } from '@/__tests__/render'; -import { EnterpriseEditionFeature } from '@/constants'; -import { nextTick } from 'vue'; - -let pinia: ReturnType; -let ssoStore: ReturnType; -let settingsStore: ReturnType; -let server: ReturnType; - -const renderComponent = createComponentRenderer(SettingsSso); - -describe('SettingsSso', () => { - beforeAll(() => { - server = setupServer(); - }); - - beforeEach(async () => { - window.open = vi.fn(); - - pinia = createPinia(); - setActivePinia(pinia); - - ssoStore = useSSOStore(); - settingsStore = useSettingsStore(); - - await settingsStore.getSettings(); - }); - - afterEach(() => { - vi.clearAllMocks(); - }); - - afterAll(() => { - server.shutdown(); - }); - - it('should render paywall state when there is no license', () => { - const { getByTestId, queryByTestId, queryByRole } = renderComponent({ - pinia, - }); - - expect(queryByRole('checkbox')).not.toBeInTheDocument(); - expect(queryByTestId('sso-content-licensed')).not.toBeInTheDocument(); - expect(getByTestId('sso-content-unlicensed')).toBeInTheDocument(); - }); - - it('should render licensed content', async () => { - settingsStore.settings.enterprise[EnterpriseEditionFeature.Saml] = true; - await nextTick(); - - const { getByTestId, queryByTestId, getByRole } = renderComponent({ - pinia, - }); - - expect(getByRole('switch')).toBeInTheDocument(); - expect(getByTestId('sso-content-licensed')).toBeInTheDocument(); - expect(queryByTestId('sso-content-unlicensed')).not.toBeInTheDocument(); - }); - - it('should enable activation checkbox and test button if data is already saved', async () => { - await ssoStore.getSamlConfig(); - settingsStore.settings.enterprise[EnterpriseEditionFeature.Saml] = true; - await nextTick(); - - const { container, getByTestId, getByRole } = renderComponent({ - pinia, - }); - - const xmlRadioButton = getByTestId('radio-button-xml'); - await userEvent.click(xmlRadioButton); - - await retry(() => - expect(container.querySelector('textarea[name="metadata"]')).toHaveValue( - '', - ), - ); - - expect(getByRole('switch')).toBeEnabled(); - expect(getByTestId('sso-test')).toBeEnabled(); - }); -});