mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-05 17:53:12 +02:00
test: extract irrelevant details
This commit is contained in:
parent
434abe9c71
commit
d38fbdb184
@ -9,7 +9,7 @@ import {
|
|||||||
DEFAULT_STRATEGY_SEGMENTS_LIMIT,
|
DEFAULT_STRATEGY_SEGMENTS_LIMIT,
|
||||||
} from '../../util/segments';
|
} from '../../util/segments';
|
||||||
import type TestAgent from 'supertest/lib/agent';
|
import type TestAgent from 'supertest/lib/agent';
|
||||||
import type { IUnleashStores } from '../../types';
|
import type { IUnleashStores, IVariant } from '../../types';
|
||||||
|
|
||||||
const uiConfig = {
|
const uiConfig = {
|
||||||
headerBackground: 'red',
|
headerBackground: 'red',
|
||||||
@ -109,22 +109,21 @@ describe('hideFeatureEnvironmentVariants', () => {
|
|||||||
expect(body.flags.hideFeatureEnvironmentVariants).toEqual(true);
|
expect(body.flags.hideFeatureEnvironmentVariants).toEqual(true);
|
||||||
});
|
});
|
||||||
test('ui config should have hideFeatureEnvironmentVariants flag disabled if env variants are used', async () => {
|
test('ui config should have hideFeatureEnvironmentVariants flag disabled if env variants are used', async () => {
|
||||||
|
const someVariant: IVariant = {
|
||||||
|
name: 'a',
|
||||||
|
weight: 1,
|
||||||
|
weightType: 'fix',
|
||||||
|
stickiness: 'default',
|
||||||
|
};
|
||||||
await stores.featureEnvironmentStore.addEnvironmentToFeature(
|
await stores.featureEnvironmentStore.addEnvironmentToFeature(
|
||||||
'test',
|
'feature',
|
||||||
'default',
|
'production',
|
||||||
true,
|
true,
|
||||||
);
|
);
|
||||||
await stores.featureEnvironmentStore.addVariantsToFeatureEnvironment(
|
await stores.featureEnvironmentStore.addVariantsToFeatureEnvironment(
|
||||||
'test',
|
'feature',
|
||||||
'default',
|
'production',
|
||||||
[
|
[someVariant],
|
||||||
{
|
|
||||||
name: 'a',
|
|
||||||
weight: 1,
|
|
||||||
weightType: 'fix',
|
|
||||||
stickiness: 'default',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
);
|
);
|
||||||
const { body } = await request
|
const { body } = await request
|
||||||
.get(`${base}/api/admin/ui-config`)
|
.get(`${base}/api/admin/ui-config`)
|
||||||
|
Loading…
Reference in New Issue
Block a user