mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-31 00:16:47 +01:00
fix: Variants should be allowed to be 'null'
This commit is contained in:
parent
e3a0569ebd
commit
494a98f926
@ -1,5 +1,9 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 3.2.1
|
||||||
|
|
||||||
|
- fix: Variants should be allowed to be 'null'
|
||||||
|
|
||||||
## 3.2.0
|
## 3.2.0
|
||||||
|
|
||||||
- feat: Add beta support for toggle variants
|
- feat: Add beta support for toggle variants
|
||||||
|
@ -50,7 +50,8 @@ const featureShema = joi
|
|||||||
.array()
|
.array()
|
||||||
.unique((a, b) => a.name === b.name)
|
.unique((a, b) => a.name === b.name)
|
||||||
.optional()
|
.optional()
|
||||||
.items(variantsSchema),
|
.items(variantsSchema)
|
||||||
|
.allow(null),
|
||||||
})
|
})
|
||||||
.options({ allowUnknown: false, stripUnknown: true });
|
.options({ allowUnknown: false, stripUnknown: true });
|
||||||
|
|
||||||
|
@ -100,6 +100,23 @@ test('should be allowed to use new toggle name', t => {
|
|||||||
.expect(201);
|
.expect(201);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('should be allowed to have variants="null"', t => {
|
||||||
|
t.plan(0);
|
||||||
|
const { request, base, perms } = getSetup();
|
||||||
|
perms.withPermissions(CREATE_FEATURE);
|
||||||
|
|
||||||
|
return request
|
||||||
|
.post(`${base}/api/admin/features`)
|
||||||
|
.send({
|
||||||
|
name: 'new.name.null',
|
||||||
|
enabled: false,
|
||||||
|
strategies: [{ name: 'default' }],
|
||||||
|
variants: null,
|
||||||
|
})
|
||||||
|
.set('Content-Type', 'application/json')
|
||||||
|
.expect(201);
|
||||||
|
});
|
||||||
|
|
||||||
test('should not be allowed to reuse active toggle name', t => {
|
test('should not be allowed to reuse active toggle name', t => {
|
||||||
t.plan(1);
|
t.plan(1);
|
||||||
const { request, featureToggleStore, base } = getSetup();
|
const { request, featureToggleStore, base } = getSetup();
|
||||||
|
Loading…
Reference in New Issue
Block a user