Commit 465acee6 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'integrate-new-feature-flags--vuex' into 'master'

Add Version and Strategies to FF Edit State

See merge request gitlab-org/gitlab!26895
parents e0cdba92 358853bf
......@@ -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