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/user-schema.test.ts

23 lines
573 B
TypeScript
Raw Normal View History

import { validateSchema } from '../validate';
import { UserSchema } from './user-schema';
test('userSchema', () => {
const data: UserSchema = {
isAPI: false,
id: 1,
username: 'admin',
imageUrl: 'avatar',
seenAt: '2022-06-27T12:19:15.838Z',
loginAttempts: 0,
createdAt: '2022-04-08T10:59:25.072Z',
};
expect(
validateSchema('#/components/schemas/userSchema', {}),
).not.toBeUndefined();
expect(
validateSchema('#/components/schemas/userSchema', data),
).toBeUndefined();
});