chore: making the failing test pass because of parameter validation
Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user