1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-09 00:18:00 +01:00

refactor: add regression test for long parameter values (#1617)

* refactor: add regression test for long parameter values

* refactor: format file
This commit is contained in:
olav 2022-05-20 15:44:41 +02:00 committed by GitHub
parent 312b5d42e8
commit b53912aef9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 7 deletions

View File

@ -20,13 +20,7 @@ export type CreateSchemaType<T> = FromSchema<
{
definitionsPath: 'components/schemas';
deserialize: [
{
pattern: {
type: 'string';
format: 'date';
};
output: Date;
},
{ pattern: { type: 'string'; format: 'date' }; output: Date },
];
}
>;

View File

@ -2199,3 +2199,27 @@ test('should add default constraint values for single-valued constraints', async
.expect(200)
.expect((res) => expectValues(res, constraintValues.values));
});
test('should allow long parameter values', async () => {
const project = await db.stores.projectStore.create({
id: uuidv4(),
name: uuidv4(),
description: uuidv4(),
});
const toggle = await db.stores.featureToggleStore.create(project.id, {
name: uuidv4(),
});
const strategy = {
name: uuidv4(),
parameters: { a: 'b'.repeat(500) },
};
await app.request
.post(
`/api/admin/projects/${project.id}/features/${toggle.name}/environments/default/strategies`,
)
.send(strategy)
.expect(200);
});