Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
49 lines
1.5 KiB
TypeScript
49 lines
1.5 KiB
TypeScript
import { test, expect } from '../../../fixtures/base';
|
|
|
|
test.describe
|
|
.serial('Environment Feature Flags', {
|
|
annotation: [
|
|
{ type: 'owner', description: 'Adore' },
|
|
],
|
|
}, () => {
|
|
test('should set feature flags at runtime and load it back in envFeatureFlags from backend settings', async ({
|
|
api,
|
|
}) => {
|
|
const setResponse = await api.setEnvFeatureFlags({
|
|
N8N_ENV_FEAT_TEST: 'true',
|
|
});
|
|
|
|
expect(setResponse.data.success).toBe(true);
|
|
expect(setResponse.data.message).toBe('Environment feature flags updated');
|
|
|
|
expect(setResponse.data.flags).toBeInstanceOf(Object);
|
|
expect(setResponse.data.flags['N8N_ENV_FEAT_TEST']).toBe('true');
|
|
|
|
const currentFlags = await api.getEnvFeatureFlags();
|
|
|
|
expect(currentFlags).toBeInstanceOf(Object);
|
|
expect(currentFlags.data['N8N_ENV_FEAT_TEST']).toBe('true');
|
|
});
|
|
|
|
test('should reset feature flags at runtime', async ({ api }) => {
|
|
const setResponse1 = await api.setEnvFeatureFlags({
|
|
N8N_ENV_FEAT_TEST: 'true',
|
|
});
|
|
|
|
expect(setResponse1.data.success).toBe(true);
|
|
expect(setResponse1.data.flags['N8N_ENV_FEAT_TEST']).toBe('true');
|
|
|
|
const clearResponse = await api.clearEnvFeatureFlags();
|
|
|
|
expect(clearResponse.data.success).toBe(true);
|
|
|
|
expect(clearResponse.data.flags).toBeInstanceOf(Object);
|
|
expect(clearResponse.data.flags['N8N_ENV_FEAT_TEST']).toBeUndefined();
|
|
|
|
const currentFlags = await api.getEnvFeatureFlags();
|
|
|
|
expect(currentFlags).toBeInstanceOf(Object);
|
|
expect(currentFlags.data['N8N_ENV_FEAT_TEST']).toBeUndefined();
|
|
});
|
|
});
|