1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00
unleash.unleash/src/lib/openapi/spec/project-schema.test.ts
2023-02-10 15:05:57 +01:00

38 lines
940 B
TypeScript

import { validateSchema } from '../validate';
import { ProjectSchema } from './project-schema';
test('projectSchema', () => {
const data: ProjectSchema = {
name: 'Default',
id: 'default',
description: 'Default project',
health: 74,
featureCount: 10,
memberCount: 3,
updatedAt: '2022-06-28T17:33:53.963Z',
};
expect(
validateSchema('#/components/schemas/projectSchema', {}),
).not.toBeUndefined();
expect(
validateSchema('#/components/schemas/projectSchema', data),
).toBeUndefined();
});
test('projectSchema with only required', () => {
const data: ProjectSchema = {
name: 'Default',
id: 'default',
};
expect(
validateSchema('#/components/schemas/projectSchema', {}),
).not.toBeUndefined();
expect(
validateSchema('#/components/schemas/projectSchema', data),
).toBeUndefined();
});