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
eaebe279
Commit
eaebe279
authored
May 11, 2020
by
Ezekiel Kigbo
Committed by
Martin Wortschack
May 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added fixture spec for time summary
Adds fixture spec to generate mock data for the FE specs
parent
f9ac8102
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
ee/spec/frontend/analytics/cycle_analytics/mock_data.js
ee/spec/frontend/analytics/cycle_analytics/mock_data.js
+3
-4
ee/spec/frontend/fixtures/analytics.rb
ee/spec/frontend/fixtures/analytics.rb
+6
-0
No files found.
ee/spec/frontend/analytics/cycle_analytics/mock_data.js
View file @
eaebe279
...
@@ -21,12 +21,14 @@ const fixtureEndpoints = {
...
@@ -21,12 +21,14 @@ const fixtureEndpoints = {
stageEvents
:
stage
=>
`analytics/value_stream_analytics/stages/
${
stage
}
/records.json`
,
stageEvents
:
stage
=>
`analytics/value_stream_analytics/stages/
${
stage
}
/records.json`
,
stageMedian
:
stage
=>
`analytics/value_stream_analytics/stages/
${
stage
}
/median.json`
,
stageMedian
:
stage
=>
`analytics/value_stream_analytics/stages/
${
stage
}
/median.json`
,
recentActivityData
:
'
analytics/value_stream_analytics/summary.json
'
,
recentActivityData
:
'
analytics/value_stream_analytics/summary.json
'
,
timeMetricsData
:
'
analytics/value_stream_analytics/time_summary.json
'
,
groupLabels
:
'
api/group_labels.json
'
,
groupLabels
:
'
api/group_labels.json
'
,
};
};
export
const
endpoints
=
{
export
const
endpoints
=
{
groupLabels
:
/groups
\/[
A-Z|a-z|
\d
|
\-
|_
]
+
\/
-
\/
labels.json/
,
groupLabels
:
/groups
\/[
A-Z|a-z|
\d
|
\-
|_
]
+
\/
-
\/
labels.json/
,
recentActivityData
:
/analytics
\/
value_stream_analytics
\/
summary/
,
recentActivityData
:
/analytics
\/
value_stream_analytics
\/
summary/
,
timeMetricsData
:
/analytics
\/
value_stream_analytics
\/
time_summary/
,
durationData
:
/analytics
\/
value_stream_analytics
\/
stages
\/\d
+
\/
duration_chart/
,
durationData
:
/analytics
\/
value_stream_analytics
\/
stages
\/\d
+
\/
duration_chart/
,
stageData
:
/analytics
\/
value_stream_analytics
\/
stages
\/\d
+
\/
records/
,
stageData
:
/analytics
\/
value_stream_analytics
\/
stages
\/\d
+
\/
records/
,
stageMedian
:
/analytics
\/
value_stream_analytics
\/
stages
\/\d
+
\/
median/
,
stageMedian
:
/analytics
\/
value_stream_analytics
\/
stages
\/\d
+
\/
median/
,
...
@@ -53,10 +55,7 @@ const getStageByTitle = (stages, title) =>
...
@@ -53,10 +55,7 @@ const getStageByTitle = (stages, title) =>
stages
.
find
(
stage
=>
stage
.
title
&&
stage
.
title
.
toLowerCase
().
trim
()
===
title
)
||
{};
stages
.
find
(
stage
=>
stage
.
title
&&
stage
.
title
.
toLowerCase
().
trim
()
===
title
)
||
{};
export
const
recentActivityData
=
getJSONFixture
(
fixtureEndpoints
.
recentActivityData
);
export
const
recentActivityData
=
getJSONFixture
(
fixtureEndpoints
.
recentActivityData
);
export
const
timeMetricsData
=
[
export
const
timeMetricsData
=
getJSONFixture
(
fixtureEndpoints
.
timeMetricsData
);
{
label
:
'
Lead time
'
,
value
:
'
2
'
,
unit
:
'
days
'
},
{
label
:
'
Cycle time
'
,
value
:
'
1.5
'
,
unit
:
'
days
'
},
];
export
const
customizableStagesAndEvents
=
getJSONFixture
(
export
const
customizableStagesAndEvents
=
getJSONFixture
(
fixtureEndpoints
.
customizableCycleAnalyticsStagesAndEvents
,
fixtureEndpoints
.
customizableCycleAnalyticsStagesAndEvents
,
...
...
ee/spec/frontend/fixtures/analytics.rb
View file @
eaebe279
...
@@ -203,6 +203,12 @@ describe 'Analytics (JavaScript fixtures)', :sidekiq_inline do
...
@@ -203,6 +203,12 @@ describe 'Analytics (JavaScript fixtures)', :sidekiq_inline do
expect
(
response
).
to
be_successful
expect
(
response
).
to
be_successful
end
end
it
'analytics/value_stream_analytics/time_summary.json'
do
get
(
:show
,
params:
params
,
format: :json
)
expect
(
response
).
to
be_successful
end
end
end
describe
Analytics
::
TasksByTypeController
,
type: :controller
do
describe
Analytics
::
TasksByTypeController
,
type: :controller
do
...
...
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