Commit 358853bf authored by Andrew Fontaine's avatar Andrew Fontaine

Add Version and Strategies to FF Edit State

In preparation for the new Feature Flag UI, the new strategies and
version properties of a feature flag must be exposed as part of the Vuex
module.
parent 0b5d06d9
......@@ -20,6 +20,8 @@ export default {
state.iid = response.iid;
state.active = response.active;
state.scopes = mapToScopesViewModel(response.scopes);
state.strategies = response.strategies || [];
state.version = response.version || 1;
},
[types.RECEIVE_FEATURE_FLAG_ERROR](state) {
state.isLoading = false;
......
......@@ -11,4 +11,6 @@ export default () => ({
hasError: false,
iid: null,
active: true,
strategies: [],
version: 1,
});
......@@ -45,6 +45,8 @@ describe('Feature flags Edit Module Mutations', () => {
description: 'All environments',
scopes: [{ id: 1 }],
iid: 5,
version: 2,
strategies: [{ scopes: [], type: 'default', paramters: {} }],
};
beforeEach(() => {
......@@ -74,6 +76,14 @@ describe('Feature flags Edit Module Mutations', () => {
it('should set the iid to the provided one', () => {
expect(stateCopy.iid).toEqual(data.iid);
});
it('should set the version to the provided one', () => {
expect(stateCopy.version).toBe(2);
});
it('should set the strategies to the provided one', () => {
expect(stateCopy.strategies).toEqual([{ scopes: [], type: 'default', paramters: {} }]);
});
});
describe('RECEIVE_FEATURE_FLAG_ERROR', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment