mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
21 lines
844 B
TypeScript
21 lines
844 B
TypeScript
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);
|
|
},
|
|
);
|
|
});
|