feat(editor): Support relative dependent parameters for collection NodeProperties (#18916)

This commit is contained in:
Charlie Kolb
2025-08-28 16:34:23 +02:00
committed by GitHub
parent 44b686e944
commit a15391acc9
6 changed files with 65 additions and 8 deletions

View File

@@ -0,0 +1,20 @@
import { resolveRelativePath } from '../../src/node-parameters/path-utils';
describe('resolveRelativePath', () => {
test.each([
['parameters.level1.level2.field', '&childField', 'level1.level2.childField'],
['parameters.level1.level2[0].field', '&childField', 'level1.level2[0].childField'],
['parameters.level1.level2.field', 'absolute.path', 'absolute.path'],
['parameters', '&childField', 'childField'],
['parameters.level1.level2.field', '', ''],
['', '&childField', 'childField'],
['', '', ''],
['parameters.level1.level2.field', 'relative.path', 'relative.path'],
])(
'should resolve relative path for fullPath: %s and candidateRelativePath: %s',
(fullPath, candidateRelativePath, expected) => {
const result = resolveRelativePath(fullPath, candidateRelativePath);
expect(result).toBe(expected);
},
);
});