chore: making the failing test pass because of parameter validation

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2021-07-02 16:18:22 +02:00
parent b9cba53a05
commit 4c689b0fae
2 changed files with 12 additions and 2 deletions
@@ -83,7 +83,16 @@ describe('createRouter', () => {
owner: 'web@example.com',
type: 'website',
steps: [],
parameters: [],
parameters: {
type: 'object',
required: ['required'],
properties: {
required: {
type: 'string',
description: 'Required parameter',
},
},
},
},
};
@@ -117,7 +126,7 @@ describe('createRouter', () => {
const response = await request(app)
.post('/v2/tasks')
.send({
templateName: '',
templateName: 'create-react-app-template',
values: {
storePath: 'https://github.com/backstage/backstage',
},
@@ -164,6 +164,7 @@ export async function createRouter(
});
let taskSpec;
if (isBeta2Template(template)) {
for (const parameters of [template.spec.parameters ?? []].flat()) {
const result = validate(values, parameters);