Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
652867ef
Commit
652867ef
authored
Sep 03, 2020
by
Ezekiel Kigbo
Committed by
Simon Knox
Sep 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update cycle analytics method parameters
Updates method calls with 3+ params to take an object
parent
742ce87c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
67 additions
and
47 deletions
+67
-47
ee/app/assets/javascripts/analytics/cycle_analytics/store/actions.js
...ts/javascripts/analytics/cycle_analytics/store/actions.js
+39
-23
ee/app/assets/javascripts/analytics/cycle_analytics/store/modules/custom_stages/actions.js
...cs/cycle_analytics/store/modules/custom_stages/actions.js
+5
-1
ee/app/assets/javascripts/analytics/cycle_analytics/store/modules/duration_chart/actions.js
...s/cycle_analytics/store/modules/duration_chart/actions.js
+5
-5
ee/app/assets/javascripts/api.js
ee/app/assets/javascripts/api.js
+11
-11
ee/spec/frontend/api_spec.js
ee/spec/frontend/api_spec.js
+7
-7
No files found.
ee/app/assets/javascripts/analytics/cycle_analytics/store/actions.js
View file @
652867ef
...
@@ -53,16 +53,16 @@ export const receiveStageDataError = ({ commit }) => {
...
@@ -53,16 +53,16 @@ export const receiveStageDataError = ({ commit }) => {
createFlash
(
__
(
'
There was an error fetching data for the selected stage
'
));
createFlash
(
__
(
'
There was an error fetching data for the selected stage
'
));
};
};
export
const
fetchStageData
=
({
dispatch
,
getters
},
s
lug
)
=>
{
export
const
fetchStageData
=
({
dispatch
,
getters
},
s
tageId
)
=>
{
const
{
cycleAnalyticsRequestParams
=
{},
currentValueStreamId
,
currentGroupPath
}
=
getters
;
const
{
cycleAnalyticsRequestParams
=
{},
currentValueStreamId
,
currentGroupPath
}
=
getters
;
dispatch
(
'
requestStageData
'
);
dispatch
(
'
requestStageData
'
);
return
Api
.
cycleAnalyticsStageEvents
(
return
Api
.
cycleAnalyticsStageEvents
(
{
currentGroupPath
,
groupId
:
currentGroupPath
,
currentValueStreamId
,
valueStreamId
:
currentValueStreamId
,
s
lug
,
s
tageId
,
cycleAnalyticsRequestParams
,
cycleAnalyticsRequestParams
,
)
}
)
.
then
(({
data
})
=>
dispatch
(
'
receiveStageDataSuccess
'
,
data
))
.
then
(({
data
})
=>
dispatch
(
'
receiveStageDataSuccess
'
,
data
))
.
catch
(
error
=>
dispatch
(
'
receiveStageDataError
'
,
error
));
.
catch
(
error
=>
dispatch
(
'
receiveStageDataError
'
,
error
));
};
};
...
@@ -77,13 +77,11 @@ export const receiveStageMedianValuesError = ({ commit }) => {
...
@@ -77,13 +77,11 @@ export const receiveStageMedianValuesError = ({ commit }) => {
createFlash
(
__
(
'
There was an error fetching median data for stages
'
));
createFlash
(
__
(
'
There was an error fetching median data for stages
'
));
};
};
const
fetchStageMedian
=
(
currentGroupPath
,
currentValueStreamId
,
stageId
,
params
)
=>
const
fetchStageMedian
=
({
groupId
,
valueStreamId
,
stageId
,
params
})
=>
Api
.
cycleAnalyticsStageMedian
(
currentGroupPath
,
currentValueStreamId
,
stageId
,
params
).
then
(
Api
.
cycleAnalyticsStageMedian
({
groupId
,
valueStreamId
,
stageId
,
params
}).
then
(({
data
})
=>
({
({
data
})
=>
({
id
:
stageId
,
id
:
stageId
,
...
data
,
...
data
,
}));
}),
);
export
const
fetchStageMedianValues
=
({
dispatch
,
getters
})
=>
{
export
const
fetchStageMedianValues
=
({
dispatch
,
getters
})
=>
{
const
{
const
{
...
@@ -97,12 +95,12 @@ export const fetchStageMedianValues = ({ dispatch, getters }) => {
...
@@ -97,12 +95,12 @@ export const fetchStageMedianValues = ({ dispatch, getters }) => {
dispatch
(
'
requestStageMedianValues
'
);
dispatch
(
'
requestStageMedianValues
'
);
return
Promise
.
all
(
return
Promise
.
all
(
stageIds
.
map
(
stageId
=>
stageIds
.
map
(
stageId
=>
fetchStageMedian
(
fetchStageMedian
(
{
currentGroupPath
,
groupId
:
currentGroupPath
,
currentValueStreamId
,
valueStreamId
:
currentValueStreamId
,
stageId
,
stageId
,
cycleAnalyticsRequestParams
,
cycleAnalyticsRequestParams
,
),
}
),
),
),
)
)
.
then
(
data
=>
dispatch
(
'
receiveStageMedianValuesSuccess
'
,
data
))
.
then
(
data
=>
dispatch
(
'
receiveStageMedianValuesSuccess
'
,
data
))
...
@@ -182,9 +180,13 @@ export const fetchGroupStagesAndEvents = ({ dispatch, getters }) => {
...
@@ -182,9 +180,13 @@ export const fetchGroupStagesAndEvents = ({ dispatch, getters }) => {
dispatch
(
'
requestGroupStages
'
);
dispatch
(
'
requestGroupStages
'
);
dispatch
(
'
customStages/setStageEvents
'
,
[]);
dispatch
(
'
customStages/setStageEvents
'
,
[]);
return
Api
.
cycleAnalyticsGroupStagesAndEvents
(
groupId
,
valueStreamId
,
{
return
Api
.
cycleAnalyticsGroupStagesAndEvents
({
start_date
:
created_after
,
groupId
,
project_ids
,
valueStreamId
,
data
:
{
start_date
:
created_after
,
project_ids
,
},
})
})
.
then
(({
data
:
{
stages
=
[],
events
=
[]
}
})
=>
{
.
then
(({
data
:
{
stages
=
[],
events
=
[]
}
})
=>
{
dispatch
(
'
receiveGroupStagesSuccess
'
,
stages
);
dispatch
(
'
receiveGroupStagesSuccess
'
,
stages
);
...
@@ -232,7 +234,12 @@ export const updateStage = ({ dispatch, getters }, { id, ...params }) => {
...
@@ -232,7 +234,12 @@ export const updateStage = ({ dispatch, getters }, { id, ...params }) => {
dispatch
(
'
requestUpdateStage
'
);
dispatch
(
'
requestUpdateStage
'
);
dispatch
(
'
customStages/setSavingCustomStage
'
);
dispatch
(
'
customStages/setSavingCustomStage
'
);
return
Api
.
cycleAnalyticsUpdateStage
(
currentGroupPath
,
currentValueStreamId
,
id
,
params
)
return
Api
.
cycleAnalyticsUpdateStage
({
groupId
:
currentGroupPath
,
valueStreamId
:
currentValueStreamId
,
stageId
:
id
,
data
:
params
,
})
.
then
(({
data
})
=>
dispatch
(
'
receiveUpdateStageSuccess
'
,
data
))
.
then
(({
data
})
=>
dispatch
(
'
receiveUpdateStageSuccess
'
,
data
))
.
catch
(({
response
:
{
status
=
httpStatus
.
BAD_REQUEST
,
data
:
responseData
}
=
{}
})
=>
.
catch
(({
response
:
{
status
=
httpStatus
.
BAD_REQUEST
,
data
:
responseData
}
=
{}
})
=>
dispatch
(
'
receiveUpdateStageError
'
,
{
status
,
responseData
,
data
:
{
id
,
...
params
}
}),
dispatch
(
'
receiveUpdateStageError
'
,
{
status
,
responseData
,
data
:
{
id
,
...
params
}
}),
...
@@ -255,7 +262,11 @@ export const removeStage = ({ dispatch, getters }, stageId) => {
...
@@ -255,7 +262,11 @@ export const removeStage = ({ dispatch, getters }, stageId) => {
const
{
currentGroupPath
,
currentValueStreamId
}
=
getters
;
const
{
currentGroupPath
,
currentValueStreamId
}
=
getters
;
dispatch
(
'
requestRemoveStage
'
);
dispatch
(
'
requestRemoveStage
'
);
return
Api
.
cycleAnalyticsRemoveStage
(
currentGroupPath
,
currentValueStreamId
,
stageId
)
return
Api
.
cycleAnalyticsRemoveStage
({
groupId
:
currentGroupPath
,
valueStreamId
:
currentValueStreamId
,
stageId
,
})
.
then
(()
=>
dispatch
(
'
receiveRemoveStageSuccess
'
))
.
then
(()
=>
dispatch
(
'
receiveRemoveStageSuccess
'
))
.
catch
(
error
=>
dispatch
(
'
receiveRemoveStageError
'
,
error
));
.
catch
(
error
=>
dispatch
(
'
receiveRemoveStageError
'
,
error
));
};
};
...
@@ -312,7 +323,12 @@ export const reorderStage = ({ dispatch, getters }, initialData) => {
...
@@ -312,7 +323,12 @@ export const reorderStage = ({ dispatch, getters }, initialData) => {
const
params
=
moveAfterId
?
{
move_after_id
:
moveAfterId
}
:
{
move_before_id
:
moveBeforeId
};
const
params
=
moveAfterId
?
{
move_after_id
:
moveAfterId
}
:
{
move_before_id
:
moveBeforeId
};
return
Api
.
cycleAnalyticsUpdateStage
(
currentGroupPath
,
currentValueStreamId
,
id
,
params
)
return
Api
.
cycleAnalyticsUpdateStage
({
groupId
:
currentGroupPath
,
valueStreamId
:
currentValueStreamId
,
stageId
:
id
,
data
:
params
,
})
.
then
(({
data
})
=>
dispatch
(
'
receiveReorderStageSuccess
'
,
data
))
.
then
(({
data
})
=>
dispatch
(
'
receiveReorderStageSuccess
'
,
data
))
.
catch
(({
response
:
{
status
=
httpStatus
.
BAD_REQUEST
,
data
:
responseData
}
=
{}
})
=>
.
catch
(({
response
:
{
status
=
httpStatus
.
BAD_REQUEST
,
data
:
responseData
}
=
{}
})
=>
dispatch
(
'
receiveReorderStageError
'
,
{
status
,
responseData
}),
dispatch
(
'
receiveReorderStageError
'
,
{
status
,
responseData
}),
...
...
ee/app/assets/javascripts/analytics/cycle_analytics/store/modules/custom_stages/actions.js
View file @
652867ef
...
@@ -71,7 +71,11 @@ export const createStage = ({ dispatch, rootGetters }, data) => {
...
@@ -71,7 +71,11 @@ export const createStage = ({ dispatch, rootGetters }, data) => {
dispatch
(
'
clearFormErrors
'
);
dispatch
(
'
clearFormErrors
'
);
dispatch
(
'
setSavingCustomStage
'
);
dispatch
(
'
setSavingCustomStage
'
);
return
Api
.
cycleAnalyticsCreateStage
(
currentGroupPath
,
currentValueStreamId
,
data
)
return
Api
.
cycleAnalyticsCreateStage
({
groupId
:
currentGroupPath
,
valueStreamId
:
currentValueStreamId
,
data
,
})
.
then
(
response
=>
{
.
then
(
response
=>
{
const
{
status
,
data
:
responseData
}
=
response
;
const
{
status
,
data
:
responseData
}
=
response
;
return
dispatch
(
'
receiveCreateStageSuccess
'
,
{
status
,
data
:
responseData
});
return
dispatch
(
'
receiveCreateStageSuccess
'
,
{
status
,
data
:
responseData
});
...
...
ee/app/assets/javascripts/analytics/cycle_analytics/store/modules/duration_chart/actions.js
View file @
652867ef
...
@@ -24,12 +24,12 @@ export const fetchDurationData = ({ dispatch, commit, rootGetters }) => {
...
@@ -24,12 +24,12 @@ export const fetchDurationData = ({ dispatch, commit, rootGetters }) => {
activeStages
.
map
(
stage
=>
{
activeStages
.
map
(
stage
=>
{
const
{
slug
}
=
stage
;
const
{
slug
}
=
stage
;
return
Api
.
cycleAnalyticsDurationChart
(
return
Api
.
cycleAnalyticsDurationChart
(
{
currentGroupPath
,
groupId
:
currentGroupPath
,
currentValueStreamId
,
valueStreamId
:
currentValueStreamId
,
slug
,
s
tageId
:
s
lug
,
cycleAnalyticsRequestParams
,
cycleAnalyticsRequestParams
,
).
then
(({
data
})
=>
({
}
).
then
(({
data
})
=>
({
slug
,
slug
,
selected
:
true
,
selected
:
true
,
data
,
data
,
...
...
ee/app/assets/javascripts/api.js
View file @
652867ef
...
@@ -138,7 +138,7 @@ export default {
...
@@ -138,7 +138,7 @@ export default {
return
axios
.
get
(
url
,
{
params
});
return
axios
.
get
(
url
,
{
params
});
},
},
cycleAnalyticsGroupStagesAndEvents
(
groupId
,
valueStreamId
,
params
=
{
})
{
cycleAnalyticsGroupStagesAndEvents
(
{
groupId
,
valueStreamId
,
params
=
{}
})
{
const
url
=
Api
.
buildUrl
(
this
.
cycleAnalyticsGroupStagesAndEventsPath
)
const
url
=
Api
.
buildUrl
(
this
.
cycleAnalyticsGroupStagesAndEventsPath
)
.
replace
(
'
:id
'
,
groupId
)
.
replace
(
'
:id
'
,
groupId
)
.
replace
(
'
:value_stream_id
'
,
valueStreamId
);
.
replace
(
'
:value_stream_id
'
,
valueStreamId
);
...
@@ -146,7 +146,7 @@ export default {
...
@@ -146,7 +146,7 @@ export default {
return
axios
.
get
(
url
,
{
params
});
return
axios
.
get
(
url
,
{
params
});
},
},
cycleAnalyticsStageEvents
(
groupId
,
valueStreamId
,
stageId
,
params
=
{
})
{
cycleAnalyticsStageEvents
(
{
groupId
,
valueStreamId
,
stageId
,
params
=
{}
})
{
const
url
=
Api
.
buildUrl
(
this
.
cycleAnalyticsStageEventsPath
)
const
url
=
Api
.
buildUrl
(
this
.
cycleAnalyticsStageEventsPath
)
.
replace
(
'
:id
'
,
groupId
)
.
replace
(
'
:id
'
,
groupId
)
.
replace
(
'
:value_stream_id
'
,
valueStreamId
)
.
replace
(
'
:value_stream_id
'
,
valueStreamId
)
...
@@ -155,7 +155,7 @@ export default {
...
@@ -155,7 +155,7 @@ export default {
return
axios
.
get
(
url
,
{
params
});
return
axios
.
get
(
url
,
{
params
});
},
},
cycleAnalyticsStageMedian
(
groupId
,
valueStreamId
,
stageId
,
params
=
{
})
{
cycleAnalyticsStageMedian
(
{
groupId
,
valueStreamId
,
stageId
,
params
=
{}
})
{
const
url
=
Api
.
buildUrl
(
this
.
cycleAnalyticsStageMedianPath
)
const
url
=
Api
.
buildUrl
(
this
.
cycleAnalyticsStageMedianPath
)
.
replace
(
'
:id
'
,
groupId
)
.
replace
(
'
:id
'
,
groupId
)
.
replace
(
'
:value_stream_id
'
,
valueStreamId
)
.
replace
(
'
:value_stream_id
'
,
valueStreamId
)
...
@@ -164,7 +164,7 @@ export default {
...
@@ -164,7 +164,7 @@ export default {
return
axios
.
get
(
url
,
{
params
:
{
...
params
}
});
return
axios
.
get
(
url
,
{
params
:
{
...
params
}
});
},
},
cycleAnalyticsCreateStage
(
groupId
,
valueStreamId
,
data
)
{
cycleAnalyticsCreateStage
(
{
groupId
,
valueStreamId
,
data
}
)
{
const
url
=
Api
.
buildUrl
(
this
.
cycleAnalyticsGroupStagesAndEventsPath
)
const
url
=
Api
.
buildUrl
(
this
.
cycleAnalyticsGroupStagesAndEventsPath
)
.
replace
(
'
:id
'
,
groupId
)
.
replace
(
'
:id
'
,
groupId
)
.
replace
(
'
:value_stream_id
'
,
valueStreamId
);
.
replace
(
'
:value_stream_id
'
,
valueStreamId
);
...
@@ -182,30 +182,30 @@ export default {
...
@@ -182,30 +182,30 @@ export default {
return
axios
.
get
(
url
,
data
);
return
axios
.
get
(
url
,
data
);
},
},
cycleAnalyticsStageUrl
(
groupId
,
valueStreamId
,
stageId
)
{
cycleAnalyticsStageUrl
(
{
groupId
,
valueStreamId
,
stageId
}
)
{
return
Api
.
buildUrl
(
this
.
cycleAnalyticsStagePath
)
return
Api
.
buildUrl
(
this
.
cycleAnalyticsStagePath
)
.
replace
(
'
:id
'
,
groupId
)
.
replace
(
'
:id
'
,
groupId
)
.
replace
(
'
:value_stream_id
'
,
valueStreamId
)
.
replace
(
'
:value_stream_id
'
,
valueStreamId
)
.
replace
(
'
:stage_id
'
,
stageId
);
.
replace
(
'
:stage_id
'
,
stageId
);
},
},
cycleAnalyticsUpdateStage
(
groupId
,
valueStreamId
,
stageId
,
data
)
{
cycleAnalyticsUpdateStage
(
{
groupId
,
valueStreamId
,
stageId
,
data
}
)
{
const
url
=
this
.
cycleAnalyticsStageUrl
(
groupId
,
valueStreamId
,
stageId
);
const
url
=
this
.
cycleAnalyticsStageUrl
(
{
groupId
,
valueStreamId
,
stageId
}
);
return
axios
.
put
(
url
,
data
);
return
axios
.
put
(
url
,
data
);
},
},
cycleAnalyticsRemoveStage
(
groupId
,
valueStreamId
,
stageId
)
{
cycleAnalyticsRemoveStage
(
{
groupId
,
valueStreamId
,
stageId
}
)
{
const
url
=
this
.
cycleAnalyticsStageUrl
(
groupId
,
valueStreamId
,
stageId
);
const
url
=
this
.
cycleAnalyticsStageUrl
(
{
groupId
,
valueStreamId
,
stageId
}
);
return
axios
.
delete
(
url
);
return
axios
.
delete
(
url
);
},
},
cycleAnalyticsDurationChart
(
groupId
,
valueStreamId
,
stageSlug
,
params
=
{
})
{
cycleAnalyticsDurationChart
(
{
groupId
,
valueStreamId
,
stageId
,
params
=
{}
})
{
const
url
=
Api
.
buildUrl
(
this
.
cycleAnalyticsDurationChartPath
)
const
url
=
Api
.
buildUrl
(
this
.
cycleAnalyticsDurationChartPath
)
.
replace
(
'
:id
'
,
groupId
)
.
replace
(
'
:id
'
,
groupId
)
.
replace
(
'
:value_stream_id
'
,
valueStreamId
)
.
replace
(
'
:value_stream_id
'
,
valueStreamId
)
.
replace
(
'
:stage_id
'
,
stage
Slug
);
.
replace
(
'
:stage_id
'
,
stage
Id
);
return
axios
.
get
(
url
,
{
return
axios
.
get
(
url
,
{
params
,
params
,
...
...
ee/spec/frontend/api_spec.js
View file @
652867ef
...
@@ -381,7 +381,7 @@ describe('Api', () => {
...
@@ -381,7 +381,7 @@ describe('Api', () => {
const
expectedUrl
=
valueStreamBaseUrl
({
id
:
valueStreamId
,
resource
:
'
stages
'
});
const
expectedUrl
=
valueStreamBaseUrl
({
id
:
valueStreamId
,
resource
:
'
stages
'
});
mock
.
onGet
(
expectedUrl
).
reply
(
httpStatus
.
OK
,
response
);
mock
.
onGet
(
expectedUrl
).
reply
(
httpStatus
.
OK
,
response
);
Api
.
cycleAnalyticsGroupStagesAndEvents
(
groupId
,
valueStreamId
,
params
)
Api
.
cycleAnalyticsGroupStagesAndEvents
(
{
groupId
,
valueStreamId
,
params
}
)
.
then
(
responseObj
=>
.
then
(
responseObj
=>
expectRequestWithCorrectParameters
(
responseObj
,
{
expectRequestWithCorrectParameters
(
responseObj
,
{
response
,
response
,
...
@@ -404,7 +404,7 @@ describe('Api', () => {
...
@@ -404,7 +404,7 @@ describe('Api', () => {
});
});
mock
.
onGet
(
expectedUrl
).
reply
(
httpStatus
.
OK
,
response
);
mock
.
onGet
(
expectedUrl
).
reply
(
httpStatus
.
OK
,
response
);
Api
.
cycleAnalyticsStageEvents
(
groupId
,
valueStreamId
,
stageId
,
params
)
Api
.
cycleAnalyticsStageEvents
(
{
groupId
,
valueStreamId
,
stageId
,
params
}
)
.
then
(
responseObj
=>
.
then
(
responseObj
=>
expectRequestWithCorrectParameters
(
responseObj
,
{
expectRequestWithCorrectParameters
(
responseObj
,
{
response
,
response
,
...
@@ -427,7 +427,7 @@ describe('Api', () => {
...
@@ -427,7 +427,7 @@ describe('Api', () => {
});
});
mock
.
onGet
(
expectedUrl
).
reply
(
httpStatus
.
OK
,
response
);
mock
.
onGet
(
expectedUrl
).
reply
(
httpStatus
.
OK
,
response
);
Api
.
cycleAnalyticsStageMedian
(
groupId
,
valueStreamId
,
stageId
,
params
)
Api
.
cycleAnalyticsStageMedian
(
{
groupId
,
valueStreamId
,
stageId
,
params
}
)
.
then
(
responseObj
=>
.
then
(
responseObj
=>
expectRequestWithCorrectParameters
(
responseObj
,
{
expectRequestWithCorrectParameters
(
responseObj
,
{
response
,
response
,
...
@@ -456,7 +456,7 @@ describe('Api', () => {
...
@@ -456,7 +456,7 @@ describe('Api', () => {
});
});
mock
.
onPost
(
expectedUrl
).
reply
(
httpStatus
.
OK
,
response
);
mock
.
onPost
(
expectedUrl
).
reply
(
httpStatus
.
OK
,
response
);
Api
.
cycleAnalyticsCreateStage
(
groupId
,
valueStreamId
,
customStage
)
Api
.
cycleAnalyticsCreateStage
(
{
groupId
,
valueStreamId
,
data
:
customStage
}
)
.
then
(({
data
,
config
:
{
data
:
reqData
,
url
}
})
=>
{
.
then
(({
data
,
config
:
{
data
:
reqData
,
url
}
})
=>
{
expect
(
data
).
toEqual
(
response
);
expect
(
data
).
toEqual
(
response
);
expect
(
JSON
.
parse
(
reqData
)).
toMatchObject
(
customStage
);
expect
(
JSON
.
parse
(
reqData
)).
toMatchObject
(
customStage
);
...
@@ -478,7 +478,7 @@ describe('Api', () => {
...
@@ -478,7 +478,7 @@ describe('Api', () => {
});
});
mock
.
onPut
(
expectedUrl
).
reply
(
httpStatus
.
OK
,
response
);
mock
.
onPut
(
expectedUrl
).
reply
(
httpStatus
.
OK
,
response
);
Api
.
cycleAnalyticsUpdateStage
(
groupId
,
valueStreamId
,
stageId
,
stageData
)
Api
.
cycleAnalyticsUpdateStage
(
{
groupId
,
valueStreamId
,
stageId
,
data
:
stageData
}
)
.
then
(({
data
,
config
:
{
data
:
reqData
,
url
}
})
=>
{
.
then
(({
data
,
config
:
{
data
:
reqData
,
url
}
})
=>
{
expect
(
data
).
toEqual
(
response
);
expect
(
data
).
toEqual
(
response
);
expect
(
JSON
.
parse
(
reqData
)).
toMatchObject
(
stageData
);
expect
(
JSON
.
parse
(
reqData
)).
toMatchObject
(
stageData
);
...
@@ -498,7 +498,7 @@ describe('Api', () => {
...
@@ -498,7 +498,7 @@ describe('Api', () => {
});
});
mock
.
onDelete
(
expectedUrl
).
reply
(
httpStatus
.
OK
,
response
);
mock
.
onDelete
(
expectedUrl
).
reply
(
httpStatus
.
OK
,
response
);
Api
.
cycleAnalyticsRemoveStage
(
groupId
,
valueStreamId
,
stageId
)
Api
.
cycleAnalyticsRemoveStage
(
{
groupId
,
valueStreamId
,
stageId
}
)
.
then
(({
data
,
config
:
{
url
}
})
=>
{
.
then
(({
data
,
config
:
{
url
}
})
=>
{
expect
(
data
).
toEqual
(
response
);
expect
(
data
).
toEqual
(
response
);
...
@@ -519,7 +519,7 @@ describe('Api', () => {
...
@@ -519,7 +519,7 @@ describe('Api', () => {
});
});
mock
.
onGet
(
expectedUrl
).
reply
(
httpStatus
.
OK
,
response
);
mock
.
onGet
(
expectedUrl
).
reply
(
httpStatus
.
OK
,
response
);
Api
.
cycleAnalyticsDurationChart
(
groupId
,
valueStreamId
,
stageId
,
params
)
Api
.
cycleAnalyticsDurationChart
(
{
groupId
,
valueStreamId
,
stageId
,
params
}
)
.
then
(
responseObj
=>
.
then
(
responseObj
=>
expectRequestWithCorrectParameters
(
responseObj
,
{
expectRequestWithCorrectParameters
(
responseObj
,
{
response
,
response
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment