mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-04 00:18:01 +01:00
28 lines
709 B
TypeScript
28 lines
709 B
TypeScript
|
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();
|
||
|
});
|