Skip to content

Commit a7d2bf4

Browse files
committed
chore: stringify table variable object
1 parent f84d759 commit a7d2bf4

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

packages/backend/src/helpers/__tests__/compute-parameters.test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ const executionSteps = [
1515
numberProp: 123,
1616
'space separated prop': 'space separated value',
1717
arrayProp: ['array value 1', 'hehe', 'array value 3'], // for-each intro
18+
tableProp: {
19+
rows: [{ data: { name: 'John' } }],
20+
columns: [{ id: 'name', name: 'Name', value: 'name' }],
21+
},
1822
},
1923
} as unknown as ExecutionStep,
2024
]
@@ -149,6 +153,15 @@ describe('compute parameters', () => {
149153
},
150154
},
151155
},
156+
{
157+
testDescription: 'entire object',
158+
params: {
159+
param1: `{{step.${randomStepID}.tableProp}}`,
160+
},
161+
expected: {
162+
param1: JSON.stringify(executionSteps[0].dataOut.tableProp),
163+
},
164+
},
152165
])(
153166
'performs variable substitution on $testDescription',
154167
({ params, expected }) => {

packages/backend/src/helpers/compute-parameters.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ function findAndSubstituteVariables(
126126
? preprocessVariable(parameterKey, dataValue)
127127
: Array.isArray(dataValue)
128128
? dataValue.join(', ')
129+
: typeof dataValue === 'object'
130+
? JSON.stringify(dataValue)
129131
: dataValue
130132
}
131133

0 commit comments

Comments
 (0)