Skip to content
GitLab
菜单
为什么选择 GitLab
定价
联系销售
探索
为什么选择 GitLab
定价
联系销售
探索
登录
获取免费试用
主导航
搜索或转到…
项目
GitLab
管理
动态
成员
标记
计划
议题
议题看板
里程碑
迭代
需求
代码
合并请求
仓库
分支
提交
标签
仓库图
比较修订版本
代码片段
锁定的文件
构建
流水线
作业
流水线计划
测试用例
产物
部署
发布
Package registry
Container registry
模型注册表
运维
环境
Terraform 模块
监控
事件
服务台
分析
价值流分析
贡献者分析
CI/CD 分析
仓库分析
代码评审分析
议题分析
洞察
模型实验
效能分析
帮助
帮助
支持
GitLab 文档
比较 GitLab 各版本
社区论坛
为极狐GitLab 提交贡献
提交反馈
隐私声明
快捷键
?
新增功能
4
代码片段
群组
项目
显示更多面包屑
gitlab-cn
GitLab
提交
4b99ba23
未验证
提交
4b99ba23
编辑于
4 years ago
作者:
Ezekiel Kigbo
浏览文件
操作
下载
补丁
差异文件
Move chart specs into a separate file
Moves the chart specs for VSA into a separate spec file
上级
a8097380
No related branches found
No related tags found
无相关合并请求
变更
2
隐藏空白变更内容
行内
左右并排
显示
2 个更改的文件
ee/spec/features/analytics/cycle_analytics/cycle_analytics_spec.rb
+0
-91
0 个添加, 91 个删除
...eatures/analytics/cycle_analytics/cycle_analytics_spec.rb
ee/spec/features/groups/analytics/cycle_analytics/charts_spec.rb
+141
-0
141 个添加, 0 个删除
.../features/groups/analytics/cycle_analytics/charts_spec.rb
有
141 个添加
和
91 个删除
ee/spec/features/analytics/cycle_analytics/cycle_analytics_spec.rb
+
0
−
91
浏览文件 @
4b99ba23
...
@@ -385,51 +385,6 @@ def create_merge_request(id, extra_params = {})
...
@@ -385,51 +385,6 @@ def create_merge_request(id, extra_params = {})
end
end
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
describe
'Customizable cycle analytics'
,
:js
do
custom_stage_name
=
'Cool beans'
custom_stage_name
=
'Cool beans'
custom_stage_with_labels_name
=
'Cool beans - now with labels'
custom_stage_with_labels_name
=
'Cool beans - now with labels'
...
@@ -920,52 +875,6 @@ def active_stages
...
@@ -920,52 +875,6 @@ def active_stages
end
end
end
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
end
end
...
...
此差异已折叠。
点击以展开。
ee/spec/features/groups/analytics/cycle_analytics/charts_spec.rb
0 → 100644
+
141
−
0
浏览文件 @
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
此差异已折叠。
点击以展开。
预览
0%
加载中
请重试
或
添加新附件
.
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
保存评论
取消
想要评论请
注册
或
登录