mirror of
https://github.com/Unleash/unleash.git
synced 2024-11-01 19:07:38 +01:00
31 lines
863 B
TypeScript
31 lines
863 B
TypeScript
|
import { validateSchema } from '../validate';
|
||
|
import { FeatureEnvironmentSchema } from './feature-environment-schema';
|
||
|
|
||
|
test('featureEnvironmentSchema', () => {
|
||
|
const data: FeatureEnvironmentSchema = {
|
||
|
name: '',
|
||
|
enabled: true,
|
||
|
strategies: [
|
||
|
{
|
||
|
id: '',
|
||
|
featureName: '',
|
||
|
projectId: '',
|
||
|
environment: '',
|
||
|
strategyName: '',
|
||
|
constraints: [{ contextName: '', operator: 'IN' }],
|
||
|
parameters: { a: '' },
|
||
|
},
|
||
|
],
|
||
|
};
|
||
|
|
||
|
expect(
|
||
|
validateSchema('#/components/schemas/featureEnvironmentSchema', data),
|
||
|
).toBeUndefined();
|
||
|
});
|
||
|
|
||
|
test('featureEnvironmentSchema empty', () => {
|
||
|
expect(
|
||
|
validateSchema('#/components/schemas/featureEnvironmentSchema', {}),
|
||
|
).toMatchSnapshot();
|
||
|
});
|