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
5e3c5d67
Commit
5e3c5d67
authored
Jun 10, 2020
by
Albert Salim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test pushing of frontend feature flag
parent
dc255db1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
22 deletions
+38
-22
ee/spec/features/groups/analytics/cycle_analytics_spec.rb
ee/spec/features/groups/analytics/cycle_analytics_spec.rb
+0
-22
ee/spec/features/issues/issue_sidebar_spec.rb
ee/spec/features/issues/issue_sidebar_spec.rb
+15
-0
ee/spec/support/features/matchers/pushed_frontend_feature_flags_matcher.rb
...eatures/matchers/pushed_frontend_feature_flags_matcher.rb
+23
-0
No files found.
ee/spec/features/groups/analytics/cycle_analytics_spec.rb
View file @
5e3c5d67
...
...
@@ -6,28 +6,6 @@ RSpec.describe 'Group value stream analytics' do
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
RSpec
::
Matchers
.
define
:have_pushed_frontend_feature_flags
do
|
expected
|
def
to_js
(
key
,
value
)
"
\"
#{
key
}
\"
:
#{
value
}
"
end
match
do
|
actual
|
expected
.
all?
do
|
feature_flag_name
,
enabled
|
page
.
html
.
include?
(
to_js
(
feature_flag_name
,
enabled
))
end
end
failure_message
do
|
actual
|
missing
=
expected
.
select
do
|
feature_flag_name
,
enabled
|
!
page
.
html
.
include?
(
to_js
(
feature_flag_name
,
enabled
))
end
formatted_missing_flags
=
missing
.
map
{
|
feature_flag_name
,
enabled
|
to_js
(
feature_flag_name
,
enabled
)
}.
join
(
"
\n
"
)
"The following feature flag(s) cannot be found in the frontend HTML source:
#{
formatted_missing_flags
}
"
end
end
before
do
stub_licensed_features
(
cycle_analytics_for_groups:
true
)
...
...
ee/spec/features/issues/issue_sidebar_spec.rb
View file @
5e3c5d67
...
...
@@ -111,6 +111,21 @@ RSpec.describe 'Issue Sidebar' do
expect
(
page
).
not_to
have_selector
(
'.block.health-status'
)
end
end
it
'pushes frontend feature flag saveIssuableHealthStatus'
do
visit_issue
(
project
,
issue
)
expect
(
page
).
to
have_pushed_frontend_feature_flags
(
saveIssuableHealthStatus:
true
)
end
context
'when save_issuable_health_status feature flag is disabled'
do
it
'pushes disabled frontend feature flag saveIssuableHealthStatus'
do
stub_feature_flags
(
save_issuable_health_status:
false
)
visit_issue
(
project
,
issue
)
expect
(
page
).
to
have_pushed_frontend_feature_flags
(
saveIssuableHealthStatus:
false
)
end
end
end
def
visit_issue
(
project
,
issue
)
...
...
ee/spec/support/features/matchers/pushed_frontend_feature_flags_matcher.rb
0 → 100644
View file @
5e3c5d67
# frozen_string_literal: true
RSpec
::
Matchers
.
define
:have_pushed_frontend_feature_flags
do
|
expected
|
def
to_js
(
key
,
value
)
"
\"
#{
key
}
\"
:
#{
value
}
"
end
match
do
|
actual
|
expected
.
all?
do
|
feature_flag_name
,
enabled
|
page
.
html
.
include?
(
to_js
(
feature_flag_name
,
enabled
))
end
end
failure_message
do
|
actual
|
missing
=
expected
.
select
do
|
feature_flag_name
,
enabled
|
!
page
.
html
.
include?
(
to_js
(
feature_flag_name
,
enabled
))
end
formatted_missing_flags
=
missing
.
map
{
|
feature_flag_name
,
enabled
|
to_js
(
feature_flag_name
,
enabled
)
}.
join
(
"
\n
"
)
"The following feature flag(s) cannot be found in the frontend HTML source:
#{
formatted_missing_flags
}
"
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