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
bb16bb21
Commit
bb16bb21
authored
Jun 07, 2021
by
Vitaly Slobodin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add feature tests to admin dashboard
parent
179157aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
6 deletions
+52
-6
ee/spec/features/admin/admin_dashboard_spec.rb
ee/spec/features/admin/admin_dashboard_spec.rb
+52
-6
No files found.
ee/spec/features/admin/admin_dashboard_spec.rb
View file @
bb16bb21
...
...
@@ -3,15 +3,15 @@
require
'spec_helper'
RSpec
.
describe
'Admin Dashboard'
do
before
do
admin
=
create
(
:admin
)
sign_in
(
admin
)
gitlab_enable_admin_mode_sign_in
(
admin
)
end
describe
'Users statistic'
do
let_it_be
(
:users_statistics
)
{
create
(
:users_statistics
)
}
before
do
admin
=
create
(
:admin
)
sign_in
(
admin
)
gitlab_enable_admin_mode_sign_in
(
admin
)
end
describe
'license'
do
before
do
allow
(
License
).
to
receive
(
:current
).
and_return
(
license
)
...
...
@@ -72,4 +72,50 @@ RSpec.describe 'Admin Dashboard' do
expect
(
page
).
to
have_content
(
"Total users 78"
)
end
end
describe
'qrtly reconciliation alert'
,
:js
do
shared_examples
'a visible alert'
do
it
'displays an alert'
do
expect
(
page
).
to
have_selector
(
'[data-testid="qrtly-reconciliation-alert"]'
)
end
end
shared_examples
'a hidden alert'
do
it
'does not display an alert'
do
expect
(
page
).
not_to
have_selector
(
'[data-testid="qrtly-reconciliation-alert"]'
)
end
end
context
'on dotcom'
do
before
do
allow
(
Gitlab
).
to
receive
(
:com?
).
and_return
(
true
)
visit
(
admin_dashboard_stats_path
)
end
it_behaves_like
'a hidden alert'
end
context
'on self-managed'
do
before
do
allow
(
Gitlab
).
to
receive
(
:ee?
).
and_return
(
true
)
end
context
'when qrtly reconciliation is available'
do
before
do
create
(
:upcoming_reconciliation
,
:self_managed
)
visit
(
admin_license_path
)
end
it_behaves_like
'a visible alert'
end
context
'when qrtly reconciliation is not available'
do
before
do
visit
(
admin_license_path
)
end
it_behaves_like
'a hidden alert'
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