1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-06 00:07:44 +01:00
unleash.unleash/src/lib/openapi/spec/context-field-schema.test.ts

24 lines
620 B
TypeScript
Raw Normal View History

import { validateSchema } from '../validate';
import { ContextFieldSchema } from './context-field-schema';
test('contextFieldSchema', () => {
const data: ContextFieldSchema = {
name: '',
description: '',
stickiness: false,
sortOrder: 0,
createdAt: '2022-01-01T00:00:00.000Z',
legalValues: [],
};
expect(
validateSchema('#/components/schemas/contextFieldSchema', data),
).toBeUndefined();
});
test('contextFieldSchema empty', () => {
expect(
validateSchema('#/components/schemas/contextFieldSchema', {}),
).toMatchSnapshot();
});