2022-06-23 08:10:20 +02:00
|
|
|
import { validateSchema } from '../validate';
|
|
|
|
import { FeatureEnvironmentSchema } from './feature-environment-schema';
|
|
|
|
|
|
|
|
test('featureEnvironmentSchema', () => {
|
|
|
|
const data: FeatureEnvironmentSchema = {
|
|
|
|
name: '',
|
|
|
|
enabled: true,
|
|
|
|
strategies: [
|
|
|
|
{
|
|
|
|
id: '',
|
2023-01-11 09:53:43 +01:00
|
|
|
name: '',
|
2022-06-23 08:10:20 +02:00
|
|
|
constraints: [{ contextName: '', operator: 'IN' }],
|
|
|
|
parameters: { a: '' },
|
|
|
|
},
|
|
|
|
],
|
|
|
|
};
|
|
|
|
|
|
|
|
expect(
|
|
|
|
validateSchema('#/components/schemas/featureEnvironmentSchema', data),
|
|
|
|
).toBeUndefined();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('featureEnvironmentSchema empty', () => {
|
|
|
|
expect(
|
|
|
|
validateSchema('#/components/schemas/featureEnvironmentSchema', {}),
|
|
|
|
).toMatchSnapshot();
|
|
|
|
});
|