1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-11-01 19:07:38 +01:00
unleash.unleash/src/lib/openapi/spec/feature-environment-schema.test.ts

28 lines
758 B
TypeScript
Raw Normal View History

import { validateSchema } from '../validate';
import { FeatureEnvironmentSchema } from './feature-environment-schema';
test('featureEnvironmentSchema', () => {
const data: FeatureEnvironmentSchema = {
name: '',
enabled: true,
strategies: [
{
id: '',
name: '',
constraints: [{ contextName: '', operator: 'IN' }],
parameters: { a: '' },
},
],
};
expect(
validateSchema('#/components/schemas/featureEnvironmentSchema', data),
).toBeUndefined();
});
test('featureEnvironmentSchema empty', () => {
expect(
validateSchema('#/components/schemas/featureEnvironmentSchema', {}),
).toMatchSnapshot();
});