diff options
Diffstat (limited to 'spec/frontend/feature_flags/store')
4 files changed, 51 insertions, 51 deletions
diff --git a/spec/frontend/feature_flags/store/edit/actions_spec.js b/spec/frontend/feature_flags/store/edit/actions_spec.js index 9d764799d09..20cec5daac0 100644 --- a/spec/frontend/feature_flags/store/edit/actions_spec.js +++ b/spec/frontend/feature_flags/store/edit/actions_spec.js @@ -44,7 +44,7 @@ describe('Feature flags Edit Module actions', () => { }); describe('success', () => { - it('dispatches requestUpdateFeatureFlag and receiveUpdateFeatureFlagSuccess ', done => { + it('dispatches requestUpdateFeatureFlag and receiveUpdateFeatureFlagSuccess ', (done) => { const featureFlag = { name: 'feature_flag', description: 'feature flag', @@ -80,7 +80,7 @@ describe('Feature flags Edit Module actions', () => { done, ); }); - it('handles new version flags as well', done => { + it('handles new version flags as well', (done) => { const featureFlag = { name: 'name', description: 'description', @@ -117,7 +117,7 @@ describe('Feature flags Edit Module actions', () => { }); describe('error', () => { - it('dispatches requestUpdateFeatureFlag and receiveUpdateFeatureFlagError ', done => { + it('dispatches requestUpdateFeatureFlag and receiveUpdateFeatureFlagError ', (done) => { mock.onPut(`${TEST_HOST}/endpoint.json`).replyOnce(500, { message: [] }); testAction( @@ -145,7 +145,7 @@ describe('Feature flags Edit Module actions', () => { }); describe('requestUpdateFeatureFlag', () => { - it('should commit REQUEST_UPDATE_FEATURE_FLAG mutation', done => { + it('should commit REQUEST_UPDATE_FEATURE_FLAG mutation', (done) => { testAction( requestUpdateFeatureFlag, null, @@ -158,7 +158,7 @@ describe('Feature flags Edit Module actions', () => { }); describe('receiveUpdateFeatureFlagSuccess', () => { - it('should commit RECEIVE_UPDATE_FEATURE_FLAG_SUCCESS mutation', done => { + it('should commit RECEIVE_UPDATE_FEATURE_FLAG_SUCCESS mutation', (done) => { testAction( receiveUpdateFeatureFlagSuccess, null, @@ -175,7 +175,7 @@ describe('Feature flags Edit Module actions', () => { }); describe('receiveUpdateFeatureFlagError', () => { - it('should commit RECEIVE_UPDATE_FEATURE_FLAG_ERROR mutation', done => { + it('should commit RECEIVE_UPDATE_FEATURE_FLAG_ERROR mutation', (done) => { testAction( receiveUpdateFeatureFlagError, 'There was an error', @@ -200,7 +200,7 @@ describe('Feature flags Edit Module actions', () => { }); describe('success', () => { - it('dispatches requestFeatureFlag and receiveFeatureFlagSuccess ', done => { + it('dispatches requestFeatureFlag and receiveFeatureFlagSuccess ', (done) => { mock.onGet(`${TEST_HOST}/endpoint.json`).replyOnce(200, { id: 1 }); testAction( @@ -223,7 +223,7 @@ describe('Feature flags Edit Module actions', () => { }); describe('error', () => { - it('dispatches requestFeatureFlag and receiveUpdateFeatureFlagError ', done => { + it('dispatches requestFeatureFlag and receiveUpdateFeatureFlagError ', (done) => { mock.onGet(`${TEST_HOST}/endpoint.json`, {}).replyOnce(500, {}); testAction( @@ -246,7 +246,7 @@ describe('Feature flags Edit Module actions', () => { }); describe('requestFeatureFlag', () => { - it('should commit REQUEST_FEATURE_FLAG mutation', done => { + it('should commit REQUEST_FEATURE_FLAG mutation', (done) => { testAction( requestFeatureFlag, null, @@ -259,7 +259,7 @@ describe('Feature flags Edit Module actions', () => { }); describe('receiveFeatureFlagSuccess', () => { - it('should commit RECEIVE_FEATURE_FLAG_SUCCESS mutation', done => { + it('should commit RECEIVE_FEATURE_FLAG_SUCCESS mutation', (done) => { testAction( receiveFeatureFlagSuccess, { id: 1 }, @@ -272,7 +272,7 @@ describe('Feature flags Edit Module actions', () => { }); describe('receiveFeatureFlagError', () => { - it('should commit RECEIVE_FEATURE_FLAG_ERROR mutation', done => { + it('should commit RECEIVE_FEATURE_FLAG_ERROR mutation', (done) => { testAction( receiveFeatureFlagError, null, @@ -289,7 +289,7 @@ describe('Feature flags Edit Module actions', () => { }); describe('toggelActive', () => { - it('should commit TOGGLE_ACTIVE mutation', done => { + it('should commit TOGGLE_ACTIVE mutation', (done) => { testAction( toggleActive, true, diff --git a/spec/frontend/feature_flags/store/index/actions_spec.js b/spec/frontend/feature_flags/store/index/actions_spec.js index d223bb2c292..82e16958d33 100644 --- a/spec/frontend/feature_flags/store/index/actions_spec.js +++ b/spec/frontend/feature_flags/store/index/actions_spec.js @@ -40,7 +40,7 @@ describe('Feature flags actions', () => { }); describe('setFeatureFlagsOptions', () => { - it('should commit SET_FEATURE_FLAGS_OPTIONS mutation', done => { + it('should commit SET_FEATURE_FLAGS_OPTIONS mutation', (done) => { testAction( setFeatureFlagsOptions, { page: '1', scope: 'all' }, @@ -65,7 +65,7 @@ describe('Feature flags actions', () => { }); describe('success', () => { - it('dispatches requestFeatureFlags and receiveFeatureFlagsSuccess ', done => { + it('dispatches requestFeatureFlags and receiveFeatureFlagsSuccess ', (done) => { mock.onGet(`${TEST_HOST}/endpoint.json`).replyOnce(200, getRequestData, {}); testAction( @@ -88,7 +88,7 @@ describe('Feature flags actions', () => { }); describe('error', () => { - it('dispatches requestFeatureFlags and receiveFeatureFlagsError ', done => { + it('dispatches requestFeatureFlags and receiveFeatureFlagsError ', (done) => { mock.onGet(`${TEST_HOST}/endpoint.json`, {}).replyOnce(500, {}); testAction( @@ -111,7 +111,7 @@ describe('Feature flags actions', () => { }); describe('requestFeatureFlags', () => { - it('should commit RECEIVE_FEATURE_FLAGS_SUCCESS mutation', done => { + it('should commit RECEIVE_FEATURE_FLAGS_SUCCESS mutation', (done) => { testAction( requestFeatureFlags, null, @@ -124,7 +124,7 @@ describe('Feature flags actions', () => { }); describe('receiveFeatureFlagsSuccess', () => { - it('should commit RECEIVE_FEATURE_FLAGS_SUCCESS mutation', done => { + it('should commit RECEIVE_FEATURE_FLAGS_SUCCESS mutation', (done) => { testAction( receiveFeatureFlagsSuccess, { data: getRequestData, headers: {} }, @@ -142,7 +142,7 @@ describe('Feature flags actions', () => { }); describe('receiveFeatureFlagsError', () => { - it('should commit RECEIVE_FEATURE_FLAGS_ERROR mutation', done => { + it('should commit RECEIVE_FEATURE_FLAGS_ERROR mutation', (done) => { testAction( receiveFeatureFlagsError, null, @@ -160,7 +160,7 @@ describe('Feature flags actions', () => { }); describe('success', () => { - it('dispatches requestUserLists and receiveUserListsSuccess ', done => { + it('dispatches requestUserLists and receiveUserListsSuccess ', (done) => { testAction( fetchUserLists, null, @@ -181,7 +181,7 @@ describe('Feature flags actions', () => { }); describe('error', () => { - it('dispatches requestUserLists and receiveUserListsError ', done => { + it('dispatches requestUserLists and receiveUserListsError ', (done) => { Api.fetchFeatureFlagUserLists.mockRejectedValue(); testAction( @@ -204,7 +204,7 @@ describe('Feature flags actions', () => { }); describe('requestUserLists', () => { - it('should commit RECEIVE_USER_LISTS_SUCCESS mutation', done => { + it('should commit RECEIVE_USER_LISTS_SUCCESS mutation', (done) => { testAction( requestUserLists, null, @@ -217,7 +217,7 @@ describe('Feature flags actions', () => { }); describe('receiveUserListsSuccess', () => { - it('should commit RECEIVE_USER_LISTS_SUCCESS mutation', done => { + it('should commit RECEIVE_USER_LISTS_SUCCESS mutation', (done) => { testAction( receiveUserListsSuccess, { data: [userList], headers: {} }, @@ -235,7 +235,7 @@ describe('Feature flags actions', () => { }); describe('receiveUserListsError', () => { - it('should commit RECEIVE_USER_LISTS_ERROR mutation', done => { + it('should commit RECEIVE_USER_LISTS_ERROR mutation', (done) => { testAction( receiveUserListsError, null, @@ -260,7 +260,7 @@ describe('Feature flags actions', () => { }); describe('success', () => { - it('dispatches requestRotateInstanceId and receiveRotateInstanceIdSuccess ', done => { + it('dispatches requestRotateInstanceId and receiveRotateInstanceIdSuccess ', (done) => { mock.onPost(`${TEST_HOST}/endpoint.json`).replyOnce(200, rotateData, {}); testAction( @@ -283,7 +283,7 @@ describe('Feature flags actions', () => { }); describe('error', () => { - it('dispatches requestRotateInstanceId and receiveRotateInstanceIdError ', done => { + it('dispatches requestRotateInstanceId and receiveRotateInstanceIdError ', (done) => { mock.onGet(`${TEST_HOST}/endpoint.json`, {}).replyOnce(500, {}); testAction( @@ -306,7 +306,7 @@ describe('Feature flags actions', () => { }); describe('requestRotateInstanceId', () => { - it('should commit REQUEST_ROTATE_INSTANCE_ID mutation', done => { + it('should commit REQUEST_ROTATE_INSTANCE_ID mutation', (done) => { testAction( requestRotateInstanceId, null, @@ -319,7 +319,7 @@ describe('Feature flags actions', () => { }); describe('receiveRotateInstanceIdSuccess', () => { - it('should commit RECEIVE_ROTATE_INSTANCE_ID_SUCCESS mutation', done => { + it('should commit RECEIVE_ROTATE_INSTANCE_ID_SUCCESS mutation', (done) => { testAction( receiveRotateInstanceIdSuccess, { data: rotateData, headers: {} }, @@ -337,7 +337,7 @@ describe('Feature flags actions', () => { }); describe('receiveRotateInstanceIdError', () => { - it('should commit RECEIVE_ROTATE_INSTANCE_ID_ERROR mutation', done => { + it('should commit RECEIVE_ROTATE_INSTANCE_ID_ERROR mutation', (done) => { testAction( receiveRotateInstanceIdError, null, @@ -353,7 +353,7 @@ describe('Feature flags actions', () => { let mock; beforeEach(() => { - mockedState.featureFlags = getRequestData.feature_flags.map(flag => ({ + mockedState.featureFlags = getRequestData.feature_flags.map((flag) => ({ ...flag, scopes: mapToScopesViewModel(flag.scopes || []), })); @@ -364,7 +364,7 @@ describe('Feature flags actions', () => { mock.restore(); }); describe('success', () => { - it('dispatches updateFeatureFlag and receiveUpdateFeatureFlagSuccess', done => { + it('dispatches updateFeatureFlag and receiveUpdateFeatureFlagSuccess', (done) => { mock.onPut(featureFlag.update_path).replyOnce(200, featureFlag, {}); testAction( @@ -387,7 +387,7 @@ describe('Feature flags actions', () => { }); }); describe('error', () => { - it('dispatches updateFeatureFlag and receiveUpdateFeatureFlagSuccess', done => { + it('dispatches updateFeatureFlag and receiveUpdateFeatureFlagSuccess', (done) => { mock.onPut(featureFlag.update_path).replyOnce(500); testAction( @@ -412,13 +412,13 @@ describe('Feature flags actions', () => { }); describe('updateFeatureFlag', () => { beforeEach(() => { - mockedState.featureFlags = getRequestData.feature_flags.map(f => ({ + mockedState.featureFlags = getRequestData.feature_flags.map((f) => ({ ...f, scopes: mapToScopesViewModel(f.scopes || []), })); }); - it('commits UPDATE_FEATURE_FLAG with the given flag', done => { + it('commits UPDATE_FEATURE_FLAG with the given flag', (done) => { testAction( updateFeatureFlag, featureFlag, @@ -436,13 +436,13 @@ describe('Feature flags actions', () => { }); describe('receiveUpdateFeatureFlagSuccess', () => { beforeEach(() => { - mockedState.featureFlags = getRequestData.feature_flags.map(f => ({ + mockedState.featureFlags = getRequestData.feature_flags.map((f) => ({ ...f, scopes: mapToScopesViewModel(f.scopes || []), })); }); - it('commits RECEIVE_UPDATE_FEATURE_FLAG_SUCCESS with the given flag', done => { + it('commits RECEIVE_UPDATE_FEATURE_FLAG_SUCCESS with the given flag', (done) => { testAction( receiveUpdateFeatureFlagSuccess, featureFlag, @@ -460,13 +460,13 @@ describe('Feature flags actions', () => { }); describe('receiveUpdateFeatureFlagError', () => { beforeEach(() => { - mockedState.featureFlags = getRequestData.feature_flags.map(f => ({ + mockedState.featureFlags = getRequestData.feature_flags.map((f) => ({ ...f, scopes: mapToScopesViewModel(f.scopes || []), })); }); - it('commits RECEIVE_UPDATE_FEATURE_FLAG_ERROR with the given flag id', done => { + it('commits RECEIVE_UPDATE_FEATURE_FLAG_ERROR with the given flag id', (done) => { testAction( receiveUpdateFeatureFlagError, featureFlag.id, @@ -492,7 +492,7 @@ describe('Feature flags actions', () => { Api.deleteFeatureFlagUserList.mockResolvedValue(); }); - it('should refresh the user lists', done => { + it('should refresh the user lists', (done) => { testAction( deleteUserList, userList, @@ -509,7 +509,7 @@ describe('Feature flags actions', () => { Api.deleteFeatureFlagUserList.mockRejectedValue({ response: { data: 'some error' } }); }); - it('should dispatch receiveDeleteUserListError', done => { + it('should dispatch receiveDeleteUserListError', (done) => { testAction( deleteUserList, userList, @@ -529,7 +529,7 @@ describe('Feature flags actions', () => { }); describe('receiveDeleteUserListError', () => { - it('should commit RECEIVE_DELETE_USER_LIST_ERROR with the given list', done => { + it('should commit RECEIVE_DELETE_USER_LIST_ERROR with the given list', (done) => { testAction( receiveDeleteUserListError, { list: userList, error: 'mock error' }, @@ -547,7 +547,7 @@ describe('Feature flags actions', () => { }); describe('clearAlert', () => { - it('should commit RECEIVE_CLEAR_ALERT', done => { + it('should commit RECEIVE_CLEAR_ALERT', (done) => { const alertIndex = 3; testAction( diff --git a/spec/frontend/feature_flags/store/index/mutations_spec.js b/spec/frontend/feature_flags/store/index/mutations_spec.js index 376c7b069fa..eec56800a8d 100644 --- a/spec/frontend/feature_flags/store/index/mutations_spec.js +++ b/spec/frontend/feature_flags/store/index/mutations_spec.js @@ -50,7 +50,7 @@ describe('Feature flags store Mutations', () => { }); it('should set featureFlags with the transformed data', () => { - const expected = getRequestData.feature_flags.map(flag => ({ + const expected = getRequestData.feature_flags.map((flag) => ({ ...flag, scopes: mapToScopesViewModel(flag.scopes || []), })); @@ -183,7 +183,7 @@ describe('Feature flags store Mutations', () => { describe('UPDATE_FEATURE_FLAG', () => { beforeEach(() => { - stateCopy.featureFlags = getRequestData.feature_flags.map(flag => ({ + stateCopy.featureFlags = getRequestData.feature_flags.map((flag) => ({ ...flag, scopes: mapToScopesViewModel(flag.scopes || []), })); @@ -209,7 +209,7 @@ describe('Feature flags store Mutations', () => { describe('RECEIVE_UPDATE_FEATURE_FLAG_SUCCESS', () => { const runUpdate = (stateCount, flagState, featureFlagUpdateParams) => { - stateCopy.featureFlags = getRequestData.feature_flags.map(flag => ({ + stateCopy.featureFlags = getRequestData.feature_flags.map((flag) => ({ ...flag, ...flagState, scopes: mapToScopesViewModel(flag.scopes || []), @@ -237,7 +237,7 @@ describe('Feature flags store Mutations', () => { describe('RECEIVE_UPDATE_FEATURE_FLAG_ERROR', () => { beforeEach(() => { - stateCopy.featureFlags = getRequestData.feature_flags.map(flag => ({ + stateCopy.featureFlags = getRequestData.feature_flags.map((flag) => ({ ...flag, scopes: mapToScopesViewModel(flag.scopes || []), })); diff --git a/spec/frontend/feature_flags/store/new/actions_spec.js b/spec/frontend/feature_flags/store/new/actions_spec.js index 130c5235aa0..9168f11fdfb 100644 --- a/spec/frontend/feature_flags/store/new/actions_spec.js +++ b/spec/frontend/feature_flags/store/new/actions_spec.js @@ -59,7 +59,7 @@ describe('Feature flags New Module Actions', () => { }); describe('success', () => { - it('dispatches requestCreateFeatureFlag and receiveCreateFeatureFlagSuccess ', done => { + it('dispatches requestCreateFeatureFlag and receiveCreateFeatureFlagSuccess ', (done) => { const convertedActionParams = mapFromScopesViewModel(actionParams); mock.onPost(`${TEST_HOST}/endpoint.json`, convertedActionParams).replyOnce(200); @@ -81,7 +81,7 @@ describe('Feature flags New Module Actions', () => { ); }); - it('sends strategies for new style feature flags', done => { + it('sends strategies for new style feature flags', (done) => { const newVersionFlagParams = { name: 'name', description: 'description', @@ -120,7 +120,7 @@ describe('Feature flags New Module Actions', () => { }); describe('error', () => { - it('dispatches requestCreateFeatureFlag and receiveCreateFeatureFlagError ', done => { + it('dispatches requestCreateFeatureFlag and receiveCreateFeatureFlagError ', (done) => { const convertedActionParams = mapFromScopesViewModel(actionParams); mock @@ -148,7 +148,7 @@ describe('Feature flags New Module Actions', () => { }); describe('requestCreateFeatureFlag', () => { - it('should commit REQUEST_CREATE_FEATURE_FLAG mutation', done => { + it('should commit REQUEST_CREATE_FEATURE_FLAG mutation', (done) => { testAction( requestCreateFeatureFlag, null, @@ -161,7 +161,7 @@ describe('Feature flags New Module Actions', () => { }); describe('receiveCreateFeatureFlagSuccess', () => { - it('should commit RECEIVE_CREATE_FEATURE_FLAG_SUCCESS mutation', done => { + it('should commit RECEIVE_CREATE_FEATURE_FLAG_SUCCESS mutation', (done) => { testAction( receiveCreateFeatureFlagSuccess, null, @@ -178,7 +178,7 @@ describe('Feature flags New Module Actions', () => { }); describe('receiveCreateFeatureFlagError', () => { - it('should commit RECEIVE_CREATE_FEATURE_FLAG_ERROR mutation', done => { + it('should commit RECEIVE_CREATE_FEATURE_FLAG_ERROR mutation', (done) => { testAction( receiveCreateFeatureFlagError, 'There was an error', |