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,
|
||||
} from '../../util/segments';
|
||||
import type TestAgent from 'supertest/lib/agent';
|
||||
import type { IUnleashStores } from '../../types';
|
||||
import type { IUnleashStores, IVariant } from '../../types';
|
||||
|
||||
const uiConfig = {
|
||||
headerBackground: 'red',
|
||||
@ -109,22 +109,21 @@ describe('hideFeatureEnvironmentVariants', () => {
|
||||
expect(body.flags.hideFeatureEnvironmentVariants).toEqual(true);
|
||||
});
|
||||
test('ui config should have hideFeatureEnvironmentVariants flag disabled if env variants are used', async () => {
|
||||
await stores.featureEnvironmentStore.addEnvironmentToFeature(
|
||||
'test',
|
||||
'default',
|
||||
true,
|
||||
);
|
||||
await stores.featureEnvironmentStore.addVariantsToFeatureEnvironment(
|
||||
'test',
|
||||
'default',
|
||||
[
|
||||
{
|
||||
const someVariant: IVariant = {
|
||||
name: 'a',
|
||||
weight: 1,
|
||||
weightType: 'fix',
|
||||
stickiness: 'default',
|
||||
},
|
||||
],
|
||||
};
|
||||
await stores.featureEnvironmentStore.addEnvironmentToFeature(
|
||||
'feature',
|
||||
'production',
|
||||
true,
|
||||
);
|
||||
await stores.featureEnvironmentStore.addVariantsToFeatureEnvironment(
|
||||
'feature',
|
||||
'production',
|
||||
[someVariant],
|
||||
);
|
||||
const { body } = await request
|
||||
.get(`${base}/api/admin/ui-config`)
|
||||
|
Loading…
Reference in New Issue
Block a user