From 2775f617ae5c267c0a1ce7a54d05d4077cdbc0f7 Mon Sep 17 00:00:00 2001 From: oleg Date: Wed, 8 Jan 2025 16:07:46 +0100 Subject: [PATCH] fix(editor): Fix workflow initilisation for test definition routes & add unit tests (#12507) --- .../editor-ui/src/api/testDefinition.ee.ts | 4 +- .../EditDefinition/EvaluationStep.vue | 39 ++--- .../EditDefinition/NodesPinning.vue | 20 +-- .../EditDefinition/tests/NodesPinning.test.ts | 143 ++++++++++++++++++ .../src/components/TestDefinition/types.ts | 2 +- .../src/plugins/i18n/locales/en.json | 23 ++- packages/editor-ui/src/router.ts | 17 +-- .../TestDefinition/TestDefinitionEditView.vue | 18 +-- .../TestDefinition/TestDefinitionRootView.vue | 25 +++ .../TestDefinitionRunDetailView.vue | 7 +- .../tests/TestDefinitionRootView.test.ts | 87 +++++++++++ 11 files changed, 302 insertions(+), 83 deletions(-) create mode 100644 packages/editor-ui/src/components/TestDefinition/EditDefinition/tests/NodesPinning.test.ts create mode 100644 packages/editor-ui/src/views/TestDefinition/TestDefinitionRootView.vue create mode 100644 packages/editor-ui/src/views/TestDefinition/tests/TestDefinitionRootView.test.ts diff --git a/packages/editor-ui/src/api/testDefinition.ee.ts b/packages/editor-ui/src/api/testDefinition.ee.ts index c515b7a783f9f..5f4ce66ef91af 100644 --- a/packages/editor-ui/src/api/testDefinition.ee.ts +++ b/packages/editor-ui/src/api/testDefinition.ee.ts @@ -11,7 +11,7 @@ export interface TestDefinitionRecord { updatedAt?: string; createdAt?: string; annotationTag?: string | null; - mockedNodes?: Array<{ name: string }>; + mockedNodes?: Array<{ name: string; id: string }>; } interface CreateTestDefinitionParams { @@ -25,7 +25,7 @@ export interface UpdateTestDefinitionParams { evaluationWorkflowId?: string | null; annotationTagId?: string | null; description?: string | null; - mockedNodes?: Array<{ name: string }>; + mockedNodes?: Array<{ name: string; id: string }>; } export interface UpdateTestResponse { diff --git a/packages/editor-ui/src/components/TestDefinition/EditDefinition/EvaluationStep.vue b/packages/editor-ui/src/components/TestDefinition/EditDefinition/EvaluationStep.vue index 8ba5c4b657178..d2c6b6b91124d 100644 --- a/packages/editor-ui/src/components/TestDefinition/EditDefinition/EvaluationStep.vue +++ b/packages/editor-ui/src/components/TestDefinition/EditDefinition/EvaluationStep.vue @@ -2,14 +2,13 @@ import { useI18n } from '@/composables/useI18n'; import { ElCollapseTransition } from 'element-plus'; import { ref, nextTick } from 'vue'; -import N8nTooltip from 'n8n-design-system/components/N8nTooltip'; interface EvaluationStep { title: string; warning?: boolean; small?: boolean; expanded?: boolean; - tooltip?: string; + description?: string; } const props = withDefaults(defineProps(), { @@ -17,14 +16,12 @@ const props = withDefaults(defineProps(), { warning: false, small: false, expanded: true, - tooltip: '', }); const locale = useI18n(); const isExpanded = ref(props.expanded); const contentRef = ref(null); const containerRef = ref(null); -const isTooltipVisible = ref(false); const toggleExpand = async () => { isExpanded.value = !isExpanded.value; @@ -35,14 +32,6 @@ const toggleExpand = async () => { } } }; - -const showTooltip = () => { - isTooltipVisible.value = true; -}; - -const hideTooltip = () => { - isTooltipVisible.value = false; -};