1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-04 00:18:01 +01:00
unleash.unleash/src/lib/openapi/spec/segments-schema.test.ts

28 lines
709 B
TypeScript
Raw Normal View History

import { validateSchema } from '../validate';
import { SegmentsSchema } from './segments-schema';
test('updateEnvironmentSchema', () => {
const data: SegmentsSchema = {
segments: [],
};
expect(
validateSchema('#/components/schemas/segmentsSchema', data),
).toBeUndefined();
expect(
validateSchema('#/components/schemas/segmentsSchema', {
segments: [],
additional: 'property',
}),
).toBeUndefined();
expect(
validateSchema('#/components/schemas/segmentsSchema', {}),
).toMatchSnapshot();
expect(
validateSchema('#/components/schemas/segmentsSchema', 'not an object'),
).toMatchSnapshot();
});