mirror of
https://github.com/Unleash/unleash.git
synced 2024-11-01 19:07:38 +01:00
34 lines
939 B
TypeScript
34 lines
939 B
TypeScript
import { isValidField } from './import-context-validation';
|
|
|
|
test('has value context field', () => {
|
|
expect(
|
|
isValidField(
|
|
{ name: 'contextField', legalValues: [{ value: 'value1' }] },
|
|
[{ name: 'contextField', legalValues: [{ value: 'value1' }] }],
|
|
),
|
|
).toBe(true);
|
|
});
|
|
|
|
test('no matching field value', () => {
|
|
expect(
|
|
isValidField(
|
|
{ name: 'contextField', legalValues: [{ value: 'value1' }] },
|
|
[{ name: 'contextField', legalValues: [{ value: 'value2' }] }],
|
|
),
|
|
).toBe(false);
|
|
});
|
|
|
|
test('subset field value', () => {
|
|
expect(
|
|
isValidField(
|
|
{ name: 'contextField', legalValues: [{ value: 'value1' }] },
|
|
[
|
|
{
|
|
name: 'contextField',
|
|
legalValues: [{ value: 'value2' }, { value: 'value1' }],
|
|
},
|
|
],
|
|
),
|
|
).toBe(true);
|
|
});
|