diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 08:17:02 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 08:17:02 +0000 |
commit | b39512ed755239198a9c294b6a45e65c05900235 (patch) | |
tree | d234a3efade1de67c46b9e5a38ce813627726aa7 /spec/frontend/cycle_analytics/store/actions_spec.js | |
parent | d31474cf3b17ece37939d20082b07f6657cc79a9 (diff) | |
download | gitlab-ce-b39512ed755239198a9c294b6a45e65c05900235.tar.gz |
Add latest changes from gitlab-org/gitlab@15-3-stable-eev15.3.0-rc42
Diffstat (limited to 'spec/frontend/cycle_analytics/store/actions_spec.js')
-rw-r--r-- | spec/frontend/cycle_analytics/store/actions_spec.js | 56 |
1 files changed, 14 insertions, 42 deletions
diff --git a/spec/frontend/cycle_analytics/store/actions_spec.js b/spec/frontend/cycle_analytics/store/actions_spec.js index e775e941b4c..94b6de85a5c 100644 --- a/spec/frontend/cycle_analytics/store/actions_spec.js +++ b/spec/frontend/cycle_analytics/store/actions_spec.js @@ -153,6 +153,19 @@ describe('Project Value Stream Analytics actions', () => { }); }); }); + + describe('with no value stream stages available', () => { + it('will return SET_NO_ACCESS_ERROR', () => { + state = { ...state, stages: [] }; + testAction({ + action: actions.setInitialStage, + state, + payload: null, + expectedMutations: [{ type: 'SET_NO_ACCESS_ERROR' }], + expectedActions: [], + }); + }); + }); }); describe('updateStageTablePagination', () => { @@ -170,46 +183,6 @@ describe('Project Value Stream Analytics actions', () => { }); }); - describe('fetchCycleAnalyticsData', () => { - beforeEach(() => { - state = { ...defaultState, endpoints: mockEndpoints }; - mock = new MockAdapter(axios); - mock.onGet(mockRequestPath).reply(httpStatusCodes.OK); - }); - - it(`dispatches the 'setSelectedStage' and 'fetchStageData' actions`, () => - testAction({ - action: actions.fetchCycleAnalyticsData, - state, - payload: {}, - expectedMutations: [ - { type: 'REQUEST_CYCLE_ANALYTICS_DATA' }, - { type: 'RECEIVE_CYCLE_ANALYTICS_DATA_SUCCESS' }, - ], - expectedActions: [], - })); - - describe('with a failing request', () => { - beforeEach(() => { - state = { endpoints: mockEndpoints }; - mock = new MockAdapter(axios); - mock.onGet(mockRequestPath).reply(httpStatusCodes.BAD_REQUEST); - }); - - it(`commits the 'RECEIVE_CYCLE_ANALYTICS_DATA_ERROR' mutation`, () => - testAction({ - action: actions.fetchCycleAnalyticsData, - state, - payload: {}, - expectedMutations: [ - { type: 'REQUEST_CYCLE_ANALYTICS_DATA' }, - { type: 'RECEIVE_CYCLE_ANALYTICS_DATA_ERROR' }, - ], - expectedActions: [], - })); - }); - }); - describe('fetchStageData', () => { const mockStagePath = /value_streams\/\w+\/stages\/\w+\/records/; const headers = { @@ -529,14 +502,13 @@ describe('Project Value Stream Analytics actions', () => { }); describe('fetchValueStreamStageData', () => { - it('will dispatch the fetchCycleAnalyticsData, fetchStageData, fetchStageMedians and fetchStageCountValues actions', () => + it('will dispatch the fetchStageData, fetchStageMedians and fetchStageCountValues actions', () => testAction({ action: actions.fetchValueStreamStageData, state, payload: {}, expectedMutations: [], expectedActions: [ - { type: 'fetchCycleAnalyticsData' }, { type: 'fetchStageData' }, { type: 'fetchStageMedians' }, { type: 'fetchStageCountValues' }, |