Commit ad375128 authored by Takuya Noguchi's avatar Takuya Noguchi

Rename "CYCLE_ANALYTICS_*" variables in spec with "VSA_*"

This changeset is systematically generated.
Signed-off-by: default avatarTakuya Noguchi <takninnovationresearch@gmail.com>
parent 85987c47
......@@ -112,7 +112,7 @@ export const fetchStageMedianValues = ({ dispatch, commit, getters }) => {
.catch((error) => dispatch('receiveStageMedianValuesError', error));
};
export const requestCycleAnalyticsData = ({ commit }) => commit(types.REQUEST_CYCLE_ANALYTICS_DATA);
export const requestCycleAnalyticsData = ({ commit }) => commit(types.REQUEST_VALUE_STREAM_DATA);
export const receiveCycleAnalyticsDataSuccess = ({ commit, dispatch }) => {
commit(types.RECEIVE_CYCLE_ANALYTICS_DATA_SUCCESS);
......@@ -272,10 +272,10 @@ export const removeStage = ({ dispatch, getters }, stageId) => {
};
export const initializeCycleAnalyticsSuccess = ({ commit }) =>
commit(types.INITIALIZE_CYCLE_ANALYTICS_SUCCESS);
commit(types.INITIALIZE_VALUE_STREAM_SUCCESS);
export const initializeCycleAnalytics = ({ dispatch, commit }, initialData = {}) => {
commit(types.INITIALIZE_CYCLE_ANALYTICS, initialData);
commit(types.INITIALIZE_VSA, initialData);
const {
featureFlags = {},
......
......@@ -5,7 +5,7 @@ export const SET_SELECTED_STAGE = 'SET_SELECTED_STAGE';
export const SET_DATE_RANGE = 'SET_DATE_RANGE';
export const SET_SELECTED_VALUE_STREAM = 'SET_SELECTED_VALUE_STREAM';
export const REQUEST_CYCLE_ANALYTICS_DATA = 'REQUEST_CYCLE_ANALYTICS_DATA';
export const REQUEST_VALUE_STREAM_DATA = 'REQUEST_VALUE_STREAM_DATA';
export const RECEIVE_CYCLE_ANALYTICS_DATA_SUCCESS = 'RECEIVE_CYCLE_ANALYTICS_DATA_SUCCESS';
export const RECEIVE_CYCLE_ANALYTICS_DATA_ERROR = 'RECEIVE_CYCLE_ANALYTICS_DATA_ERROR';
......@@ -28,8 +28,8 @@ export const RECEIVE_UPDATE_STAGE_ERROR = 'RECEIVE_UPDATE_STAGE_ERROR';
export const REQUEST_REMOVE_STAGE = 'REQUEST_REMOVE_STAGE';
export const RECEIVE_REMOVE_STAGE_RESPONSE = 'RECEIVE_REMOVE_STAGE_RESPONSE';
export const INITIALIZE_CYCLE_ANALYTICS = 'INITIALIZE_CYCLE_ANALYTICS';
export const INITIALIZE_CYCLE_ANALYTICS_SUCCESS = 'INITIALIZE_CYCLE_ANALYTICS_SUCCESS';
export const INITIALIZE_VSA = 'INITIALIZE_VSA';
export const INITIALIZE_VALUE_STREAM_SUCCESS = 'INITIALIZE_VALUE_STREAM_SUCCESS';
export const REQUEST_REORDER_STAGE = 'REQUEST_REORDER_STAGE';
export const RECEIVE_REORDER_STAGE_SUCCESS = 'RECEIVE_REORDER_STAGE_SUCCESS';
......
......@@ -16,7 +16,7 @@ export default {
state.startDate = startDate;
state.endDate = endDate;
},
[types.REQUEST_CYCLE_ANALYTICS_DATA](state) {
[types.REQUEST_VALUE_STREAM_DATA](state) {
state.isLoading = true;
},
[types.RECEIVE_CYCLE_ANALYTICS_DATA_SUCCESS](state) {
......@@ -84,7 +84,7 @@ export default {
[types.RECEIVE_REMOVE_STAGE_RESPONSE](state) {
state.isLoading = false;
},
[types.INITIALIZE_CYCLE_ANALYTICS](
[types.INITIALIZE_VSA](
state,
{
group = null,
......@@ -103,7 +103,7 @@ export default {
state.endDate = endDate;
state.defaultStageConfig = defaultStageConfig;
},
[types.INITIALIZE_CYCLE_ANALYTICS_SUCCESS](state) {
[types.INITIALIZE_VALUE_STREAM_SUCCESS](state) {
state.isLoading = false;
},
[types.REQUEST_REORDER_STAGE](state) {
......
---
title: Rename "CYCLE_ANALYTICS_*" variables in spec with "VSA_*"
merge_request: 52609
author: Takuya Noguchi
type: other
......@@ -789,9 +789,9 @@ describe('Value Stream Analytics actions', () => {
});
describe('with only group in initialData', () => {
it('commits "INITIALIZE_CYCLE_ANALYTICS"', async () => {
it('commits "INITIALIZE_VSA"', async () => {
await actions.initializeCycleAnalytics(store, { group });
expect(mockCommit).toHaveBeenCalledWith('INITIALIZE_CYCLE_ANALYTICS', { group });
expect(mockCommit).toHaveBeenCalledWith('INITIALIZE_VSA', { group });
});
it('dispatches "fetchCycleAnalyticsData" and "initializeCycleAnalyticsSuccess"', async () => {
......@@ -818,20 +818,20 @@ describe('Value Stream Analytics actions', () => {
expect(mockDispatch).toHaveBeenCalledWith('initializeCycleAnalyticsSuccess');
});
it('commits "INITIALIZE_CYCLE_ANALYTICS"', async () => {
it('commits "INITIALIZE_VSA"', async () => {
await actions.initializeCycleAnalytics(store, initialData);
expect(mockCommit).toHaveBeenCalledWith('INITIALIZE_CYCLE_ANALYTICS', initialData);
expect(mockCommit).toHaveBeenCalledWith('INITIALIZE_VSA', initialData);
});
});
});
describe('initializeCycleAnalyticsSuccess', () => {
it(`commits the ${types.INITIALIZE_CYCLE_ANALYTICS_SUCCESS} mutation`, () =>
it(`commits the ${types.INITIALIZE_VALUE_STREAM_SUCCESS} mutation`, () =>
testAction(
actions.initializeCycleAnalyticsSuccess,
null,
state,
[{ type: types.INITIALIZE_CYCLE_ANALYTICS_SUCCESS }],
[{ type: types.INITIALIZE_VALUE_STREAM_SUCCESS }],
[],
));
});
......
......@@ -35,7 +35,7 @@ describe('Value Stream Analytics mutations', () => {
${types.REQUEST_STAGE_DATA} | ${'isLoadingStage'} | ${true}
${types.RECEIVE_STAGE_DATA_ERROR} | ${'isEmptyStage'} | ${true}
${types.RECEIVE_STAGE_DATA_ERROR} | ${'isLoadingStage'} | ${false}
${types.REQUEST_CYCLE_ANALYTICS_DATA} | ${'isLoading'} | ${true}
${types.REQUEST_VALUE_STREAM_DATA} | ${'isLoading'} | ${true}
${types.RECEIVE_GROUP_STAGES_ERROR} | ${'stages'} | ${[]}
${types.REQUEST_GROUP_STAGES} | ${'stages'} | ${[]}
${types.REQUEST_UPDATE_STAGE} | ${'isLoading'} | ${true}
......@@ -58,7 +58,7 @@ describe('Value Stream Analytics mutations', () => {
${types.REQUEST_DELETE_VALUE_STREAM} | ${'deleteValueStreamError'} | ${null}
${types.RECEIVE_DELETE_VALUE_STREAM_SUCCESS} | ${'deleteValueStreamError'} | ${null}
${types.RECEIVE_DELETE_VALUE_STREAM_SUCCESS} | ${'selectedValueStream'} | ${null}
${types.INITIALIZE_CYCLE_ANALYTICS_SUCCESS} | ${'isLoading'} | ${false}
${types.INITIALIZE_VALUE_STREAM_SUCCESS} | ${'isLoading'} | ${false}
`('$mutation will set $stateKey=$value', ({ mutation, stateKey, value }) => {
mutations[mutation](state);
......@@ -186,7 +186,7 @@ describe('Value Stream Analytics mutations', () => {
});
});
describe(`${types.INITIALIZE_CYCLE_ANALYTICS}`, () => {
describe(`${types.INITIALIZE_VSA}`, () => {
const initialData = {
group: { fullPath: 'cool-group' },
selectedProjects,
......@@ -202,7 +202,7 @@ describe('Value Stream Analytics mutations', () => {
${'endDate'} | ${initialData.createdBefore}
`('$stateKey will be set to $expectedState', ({ stateKey, expectedState }) => {
state = {};
mutations[types.INITIALIZE_CYCLE_ANALYTICS](state, initialData);
mutations[types.INITIALIZE_VSA](state, initialData);
expect(state[stateKey]).toEqual(expectedState);
});
......
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