mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 02:00:43 +00:00
Add feature flags to test
This commit is contained in:
@@ -133,6 +133,9 @@ describe('NodesLayout', () => {
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
// clear feature flags
|
||||
window.localStorage.clear();
|
||||
|
||||
options = {
|
||||
nodeCache: makeMap(),
|
||||
edgeCache: makeMap()
|
||||
@@ -416,6 +419,9 @@ describe('NodesLayout', () => {
|
||||
});
|
||||
|
||||
it('adds a new node to existing layout in a line', () => {
|
||||
// feature flag
|
||||
window.localStorage.setItem('scope-experimental:layout-dance', true);
|
||||
|
||||
let result = NodesLayout.doLayout(
|
||||
nodeSets.rank4.nodes,
|
||||
nodeSets.rank4.edges,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { storageGet, storageSet } from './storage-utils';
|
||||
|
||||
// prefix for all feature flags
|
||||
const STORAGE_KEY_PREFIX = 'scope-experimental-';
|
||||
const STORAGE_KEY_PREFIX = 'scope-experimental:';
|
||||
|
||||
const getKey = key => `${STORAGE_KEY_PREFIX}${key}`;
|
||||
|
||||
@@ -9,7 +9,7 @@ const getKey = key => `${STORAGE_KEY_PREFIX}${key}`;
|
||||
* Returns true if `feature` is enabled
|
||||
*
|
||||
* Features can be enabled either via calling `setFeature()` or by setting
|
||||
* `localStorage.scope-experimental-featureName = true` in the console.
|
||||
* `localStorage.scope-experimental:featureName = true` in the console.
|
||||
* @param {String} feature Feature name, ideally one word or hyphenated
|
||||
* @return {Boolean} True if feature is enabled
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user