test(editor): Add tests for node settings parameters composable (no-changelog) (#17232)

This commit is contained in:
Daria
2025-07-11 17:21:14 +03:00
committed by GitHub
parent 25139b2c77
commit 4eb18b7dc7
10 changed files with 272 additions and 59 deletions

View File

@@ -19,7 +19,7 @@ import {
isResourceLocatorValue,
} from 'n8n-workflow';
import type { INodeUi, IUpdateInformation } from '@/Interface';
import { SWITCH_NODE_TYPE } from '@/constants';
import { CUSTOM_API_CALL_KEY, SWITCH_NODE_TYPE } from '@/constants';
import isEqual from 'lodash/isEqual';
import get from 'lodash/get';
import set from 'lodash/set';
@@ -166,7 +166,12 @@ export function removeMismatchedOptionValues(
nodeType.properties.forEach((prop) => {
const displayOptions = prop.displayOptions;
// Not processing parameters that are not set or don't have options
if (!nodeParameterValues?.hasOwnProperty(prop.name) || !displayOptions || !prop.options) {
if (
!nodeParameterValues ||
!Object.prototype.hasOwnProperty.call(nodeParameterValues, prop.name) ||
!displayOptions ||
!prop.options
) {
return;
}
// Only process the parameters that depend on the updated parameter
@@ -353,3 +358,7 @@ export function parseFromExpression(
return null;
}
export function shouldSkipParamValidation(value: string | number | boolean | null) {
return typeof value === 'string' && value.includes(CUSTOM_API_CALL_KEY);
}