add failing test for single template expression input values in each-iterated actions

Signed-off-by: Matt Benson <gudnabrsam@gmail.com>
This commit is contained in:
Matt Benson
2023-10-23 17:47:44 -05:00
parent a7e3499c6a
commit 1a6875274b
@@ -645,6 +645,35 @@ describe('DefaultWorkflowRunner', () => {
}),
);
});
it('should run a step repeatedly with validation of single-expression value', async () => {
const numbers = [5, 7, 9];
const task = createMockTaskWithSpec({
apiVersion: 'scaffolder.backstage.io/v1beta3',
steps: [
{
id: 'test',
name: 'name',
each: '${{parameters.numbers}}',
action: 'jest-validated-action',
input: { foo: '${{each.value}}' },
},
],
output: {},
parameters: {
numbers,
},
});
await runner.execute(task);
for (const foo of numbers) {
expect(fakeActionHandler).toHaveBeenCalledWith(
expect.objectContaining({
input: { foo },
}),
);
}
});
});
describe('secrets', () => {