1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-31 00:16:47 +01:00
unleash.unleash/src/lib/openapi/spec/update-feature-strategy-segments-schema.test.ts

37 lines
980 B
TypeScript
Raw Normal View History

import { validateSchema } from '../validate';
import { UpdateFeatureStrategySegmentsSchema } from './update-feature-strategy-segments-schema';
test('updateFeatureStrategySegmentsSchema schema', () => {
const data: UpdateFeatureStrategySegmentsSchema = {
strategyId: '1',
segmentIds: [1, 2],
projectId: 'default',
environmentId: 'default',
additional: 'property',
};
expect(
validateSchema(
'#/components/schemas/updateFeatureStrategySegmentsSchema',
data,
),
).toBeUndefined();
expect(
validateSchema(
'#/components/schemas/updateFeatureStrategySegmentsSchema',
{},
),
).toMatchSnapshot();
expect(
validateSchema(
'#/components/schemas/updateFeatureStrategySegmentsSchema',
{
strategyId: '1',
segmentIds: [],
},
),
).toMatchSnapshot();
});