mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-14 00:19:16 +01:00
fix: update test
This commit is contained in:
parent
e397f7ee70
commit
b48fe585c7
@ -149,42 +149,3 @@ test('should ignore name in the body when updating feature toggle', async () =>
|
||||
expect(featureOne.description).toBe(`I'm changed`);
|
||||
expect(featureTwo.description).toBe('Second toggle');
|
||||
});
|
||||
|
||||
test('Should validate co', async () => {
|
||||
expect.assertions(1);
|
||||
const projectId = 'default';
|
||||
const username = 'co-strategy';
|
||||
const featureName = 'co-validation';
|
||||
const config: Omit<IStrategyConfig, 'id'> = {
|
||||
name: 'default',
|
||||
constraints: [
|
||||
{
|
||||
operator: 'INVALID',
|
||||
// @ts-expect-error
|
||||
values: NaN,
|
||||
contextName: 'Hello',
|
||||
},
|
||||
],
|
||||
parameters: {},
|
||||
};
|
||||
|
||||
await service.createFeatureToggle(
|
||||
projectId,
|
||||
{
|
||||
name: featureName,
|
||||
},
|
||||
'test',
|
||||
);
|
||||
|
||||
try {
|
||||
await service.createStrategy(
|
||||
config,
|
||||
{ projectId, featureName, environment: DEFAULT_ENV },
|
||||
username,
|
||||
);
|
||||
} catch (e) {
|
||||
expect(e.details[0].message).toBe(
|
||||
'"operator" must be one of [NOT_IN, IN, STR_ENDS_WITH, STR_STARTS_WITH, STR_CONTAINS, NUM_EQ, NUM_GT, NUM_GTE, NUM_LT, NUM_LTE, DATE_AFTER, DATE_BEFORE, SEMVER_EQ, SEMVER_GT, SEMVER_LT]',
|
||||
);
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user