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
d464f9e2
Commit
d464f9e2
authored
Apr 09, 2020
by
Mehmet Emin INAC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test case for `first_class_vulnerabilities` feature flag
parent
da46b9ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
12 deletions
+40
-12
ee/spec/features/groups/group_overview_spec.rb
ee/spec/features/groups/group_overview_spec.rb
+40
-12
No files found.
ee/spec/features/groups/group_overview_spec.rb
View file @
d464f9e2
...
@@ -2,11 +2,13 @@
...
@@ -2,11 +2,13 @@
require
'spec_helper'
require
'spec_helper'
describe
'Group overview'
,
:js
do
describe
'Group overview'
,
:js
,
:aggregate_failures
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:group
)
{
create
(
:group
)
}
let
(
:group
)
{
create
(
:group
)
}
let
(
:empty_project
)
{
create
(
:project
,
namespace:
group
)
}
let
(
:empty_project
)
{
create
(
:project
,
namespace:
group
)
}
subject
(
:visit_page
)
{
visit
group_path
(
group
)
}
before
do
before
do
stub_feature_flags
(
first_class_vulnerabilities:
false
)
stub_feature_flags
(
first_class_vulnerabilities:
false
)
group
.
add_owner
(
user
)
group
.
add_owner
(
user
)
...
@@ -15,7 +17,7 @@ describe 'Group overview', :js do
...
@@ -15,7 +17,7 @@ describe 'Group overview', :js do
context
'when the default value of "Group Overview content" preference is used'
do
context
'when the default value of "Group Overview content" preference is used'
do
it
'displays the Details view'
do
it
'displays the Details view'
do
visit
group_path
(
group
)
visit
_page
page
.
within
(
find
(
'.content'
))
do
page
.
within
(
find
(
'.content'
))
do
expect
(
page
).
to
have_content
'Subgroups and projects'
expect
(
page
).
to
have_content
'Subgroups and projects'
...
@@ -35,19 +37,45 @@ describe 'Group overview', :js do
...
@@ -35,19 +37,45 @@ describe 'Group overview', :js do
context
'and Security Dashboard feature is available for a group'
do
context
'and Security Dashboard feature is available for a group'
do
let
(
:group
)
{
create
(
:group_with_plan
,
plan: :gold_plan
)
}
let
(
:group
)
{
create
(
:group_with_plan
,
plan: :gold_plan
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
namespace:
group
)
}
before
do
create
(
:vulnerability
,
:with_findings
,
project:
project
)
end
context
'when the "first_class_vulnerabilities" feature flag is not enabled'
do
it
'displays the Security Dashboard view'
do
visit_page
expect
(
page
).
to
have_selector
(
'.js-security-dashboard-table'
)
it
'displays the Security Dashboard view'
do
page
.
within
(
find
(
'aside'
))
do
visit
group_path
(
group
)
expect
(
page
).
to
have_content
'Vulnerabilities over time'
expect
(
page
).
to
have_selector
(
'.js-vulnerabilities-chart-time-info'
)
expect
(
page
).
to
have_selector
(
'.js-vulnerabilities-chart-severity-level-breakdown'
)
expect
(
page
).
to
have_selector
(
'.js-security-dashboard-table'
)
expect
(
page
).
to
have_content
'Project security status'
expect
(
page
).
to
have_selector
(
'.js-projects-security-status'
)
end
page
.
within
(
all
(
'div.row'
)[
1
])
do
expect
(
page
).
not_to
have_content
'Detected'
end
end
end
context
'when the "first_class_vulnerabilities" feature flag is enabled'
do
before
do
stub_feature_flags
(
first_class_vulnerabilities:
true
)
end
page
.
within
(
find
(
'aside'
))
do
it
'loads the first class group security dashboard'
do
expect
(
page
).
to
have_content
'Vulnerabilities over time'
visit_page
expect
(
page
).
to
have_selector
(
'.js-vulnerabilities-chart-time-info'
)
expect
(
page
).
to
have_selector
(
'.js-vulnerabilities-chart-severity-level-breakdown'
)
expect
(
page
).
to
have_content
'Project security status'
page
.
within
(
all
(
'div.row'
)[
1
])
do
expect
(
page
).
to
have_selector
(
'.js-projects-security-status'
)
expect
(
page
).
to
have_content
'Detected'
expect
(
page
).
to
have_content
'Severity'
end
end
end
end
end
end
end
...
@@ -56,7 +84,7 @@ describe 'Group overview', :js do
...
@@ -56,7 +84,7 @@ describe 'Group overview', :js do
let
(
:group
)
{
create
(
:group_with_plan
,
plan: :bronze_plan
)
}
let
(
:group
)
{
create
(
:group_with_plan
,
plan: :bronze_plan
)
}
it
'displays the "Security Dashboard unavailable" empty state'
do
it
'displays the "Security Dashboard unavailable" empty state'
do
visit
group_path
(
group
)
visit
_page
page
.
within
(
find
(
'.content'
))
do
page
.
within
(
find
(
'.content'
))
do
expect
(
page
).
to
have_content
"Either you don't have permission to view this dashboard or "
\
expect
(
page
).
to
have_content
"Either you don't have permission to view this dashboard or "
\
...
...
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