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
4b99ba23
Commit
4b99ba23
authored
Sep 03, 2020
by
Ezekiel Kigbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move chart specs into a separate file
Moves the chart specs for VSA into a separate spec file
parent
a8097380
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
141 additions
and
91 deletions
+141
-91
ee/spec/features/analytics/cycle_analytics/cycle_analytics_spec.rb
...eatures/analytics/cycle_analytics/cycle_analytics_spec.rb
+0
-91
ee/spec/features/groups/analytics/cycle_analytics/charts_spec.rb
.../features/groups/analytics/cycle_analytics/charts_spec.rb
+141
-0
No files found.
ee/spec/features/analytics/cycle_analytics/cycle_analytics_spec.rb
View file @
4b99ba23
...
...
@@ -385,51 +385,6 @@ RSpec.describe 'Group Value Stream Analytics', :js do
end
end
describe
'Tasks by type chart'
,
:js
do
context
'enabled'
do
before
do
sign_in
(
user
)
end
context
'with data available'
do
before
do
3
.
times
do
|
i
|
create
(
:labeled_issue
,
created_at:
i
.
days
.
ago
,
project:
create
(
:project
,
group:
group
),
labels:
[
group_label1
])
create
(
:labeled_issue
,
created_at:
i
.
days
.
ago
,
project:
create
(
:project
,
group:
group
),
labels:
[
group_label2
])
end
select_group
end
it
'displays the chart'
do
expect
(
page
).
to
have_text
(
s_
(
'CycleAnalytics|Type of work'
))
expect
(
page
).
to
have_text
(
s_
(
'CycleAnalytics|Tasks by type'
))
end
it
'has 2 labels selected'
do
expect
(
page
).
to
have_text
(
'Showing Issues and 2 labels'
)
end
it
'has chart filters'
do
expect
(
page
).
to
have_css
(
'.js-tasks-by-type-chart-filters'
)
end
end
context
'no data available'
do
before
do
select_group
end
it
'shows the no data available message'
do
expect
(
page
).
to
have_text
(
s_
(
'CycleAnalytics|Type of work'
))
expect
(
page
).
to
have_text
(
_
(
'There is no data available. Please change your selection.'
))
end
end
end
end
describe
'Customizable cycle analytics'
,
:js
do
custom_stage_name
=
'Cool beans'
custom_stage_with_labels_name
=
'Cool beans - now with labels'
...
...
@@ -920,52 +875,6 @@ RSpec.describe 'Group Value Stream Analytics', :js do
end
end
end
context
'Duration chart'
do
let
(
:duration_chart_dropdown
)
{
page
.
find
(
duration_stage_selector
)
}
let_it_be
(
:translated_default_stage_names
)
do
Gitlab
::
Analytics
::
CycleAnalytics
::
DefaultStages
.
names
.
map
do
|
name
|
stage
=
Analytics
::
CycleAnalytics
::
GroupStage
.
new
(
name:
name
)
Analytics
::
CycleAnalytics
::
StagePresenter
.
new
(
stage
).
title
end
.
freeze
end
def
duration_chart_stages
duration_chart_dropdown
.
all
(
'.dropdown-item'
).
collect
(
&
:text
)
end
def
toggle_duration_chart_dropdown
duration_chart_dropdown
.
click
end
before
do
select_group
end
it
'has all the default stages'
do
toggle_duration_chart_dropdown
expect
(
duration_chart_stages
).
to
eq
(
translated_default_stage_names
)
end
context
'hidden stage'
do
before
do
toggle_more_options
(
first_default_stage
)
click_button
(
_
(
'Hide stage'
))
# wait for the stage list to laod
expect
(
nav
).
to
have_content
(
s_
(
'CycleAnalyticsStage|Plan'
))
end
it
'will not appear in the duration chart dropdown'
do
toggle_duration_chart_dropdown
expect
(
duration_chart_stages
).
not_to
include
(
s_
(
'CycleAnalyticsStage|Issue'
))
end
end
end
end
end
...
...
ee/spec/features/groups/analytics/cycle_analytics/charts_spec.rb
0 → 100644
View file @
4b99ba23
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
'Value stream analytics charts'
,
:js
do
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:group
)
{
create
(
:group
,
name:
'CA-test-group'
)
}
let_it_be
(
:group2
)
{
create
(
:group
,
name:
'CA-bad-test-group'
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
,
namespace:
group
,
group:
group
,
name:
'Cool fun project'
)
}
let_it_be
(
:group_label1
)
{
create
(
:group_label
,
group:
group
)
}
let_it_be
(
:group_label2
)
{
create
(
:group_label
,
group:
group
)
}
let_it_be
(
:label
)
{
create
(
:group_label
,
group:
group2
)
}
3
.
times
do
|
i
|
let_it_be
(
"issue_
#{
i
}
"
.
to_sym
)
{
create
(
:issue
,
title:
"New Issue
#{
i
}
"
,
project:
project
,
created_at:
2
.
days
.
ago
)
}
end
def
wait_for_stages_to_load
expect
(
page
).
to
have_selector
'.js-stage-table'
end
def
select_group
(
target_group
=
group
)
visit
group_analytics_cycle_analytics_path
(
target_group
)
wait_for_stages_to_load
end
def
toggle_more_options
(
stage
)
stage
.
hover
stage
.
find
(
'.more-actions-toggle'
).
click
end
before
do
stub_licensed_features
(
cycle_analytics_for_groups:
true
)
group
.
add_owner
(
user
)
sign_in
(
user
)
end
context
'Duration chart'
do
duration_stage_selector
=
'.js-dropdown-stages'
stage_nav_selector
=
'.stage-nav'
let
(
:duration_chart_dropdown
)
{
page
.
find
(
duration_stage_selector
)
}
let
(
:first_default_stage
)
{
page
.
find
(
'.stage-nav-item-cell'
,
text:
'Issue'
).
ancestor
(
'.stage-nav-item'
)
}
let
(
:nav
)
{
page
.
find
(
stage_nav_selector
)
}
let_it_be
(
:translated_default_stage_names
)
do
Gitlab
::
Analytics
::
CycleAnalytics
::
DefaultStages
.
names
.
map
do
|
name
|
stage
=
Analytics
::
CycleAnalytics
::
GroupStage
.
new
(
name:
name
)
Analytics
::
CycleAnalytics
::
StagePresenter
.
new
(
stage
).
title
end
.
freeze
end
def
duration_chart_stages
duration_chart_dropdown
.
all
(
'.dropdown-item'
).
collect
(
&
:text
)
end
def
toggle_duration_chart_dropdown
duration_chart_dropdown
.
click
end
before
do
select_group
end
it
'has all the default stages'
do
toggle_duration_chart_dropdown
expect
(
duration_chart_stages
).
to
eq
(
translated_default_stage_names
)
end
context
'hidden stage'
do
before
do
toggle_more_options
(
first_default_stage
)
click_button
(
_
(
'Hide stage'
))
# wait for the stage list to laod
expect
(
nav
).
to
have_content
(
s_
(
'CycleAnalyticsStage|Plan'
))
end
it
'will not appear in the duration chart dropdown'
do
toggle_duration_chart_dropdown
expect
(
duration_chart_stages
).
not_to
include
(
s_
(
'CycleAnalyticsStage|Issue'
))
end
end
end
describe
'Tasks by type chart'
,
:js
do
before
do
stub_licensed_features
(
cycle_analytics_for_groups:
true
,
type_of_work_analytics:
true
)
group
.
add_owner
(
user
)
project
.
add_maintainer
(
user
)
sign_in
(
user
)
end
context
'enabled'
do
context
'with data available'
do
before
do
3
.
times
do
|
i
|
create
(
:labeled_issue
,
created_at:
i
.
days
.
ago
,
project:
create
(
:project
,
group:
group
),
labels:
[
group_label1
])
create
(
:labeled_issue
,
created_at:
i
.
days
.
ago
,
project:
create
(
:project
,
group:
group
),
labels:
[
group_label2
])
end
select_group
end
it
'displays the chart'
do
expect
(
page
).
to
have_text
(
s_
(
'CycleAnalytics|Type of work'
))
expect
(
page
).
to
have_text
(
s_
(
'CycleAnalytics|Tasks by type'
))
end
it
'has 2 labels selected'
do
expect
(
page
).
to
have_text
(
'Showing Issues and 2 labels'
)
end
it
'has chart filters'
do
expect
(
page
).
to
have_css
(
'.js-tasks-by-type-chart-filters'
)
end
end
context
'no data available'
do
before
do
select_group
end
it
'shows the no data available message'
do
expect
(
page
).
to
have_text
(
s_
(
'CycleAnalytics|Type of work'
))
expect
(
page
).
to
have_text
(
_
(
'There is no data available. Please change your selection.'
))
end
end
end
end
end
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