BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
50d9cc6d
Unverified
Commit
50d9cc6d
authored
Nov 28, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix broken tests
parent
e89fad52
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
12 deletions
+23
-12
_tabs.html.haml
app/views/projects/clusters/_tabs.html.haml
+5
-6
index.html.haml
app/views/projects/clusters/index.html.haml
+2
-2
clusters_spec.rb
spec/features/projects/clusters_spec.rb
+16
-4
No files found.
app/views/projects/clusters/_tabs.html.haml
View file @
50d9cc6d
...
...
@@ -2,17 +2,16 @@
.fade-left
=
icon
(
"angle-left"
)
.fade-right
=
icon
(
"angle-right"
)
%ul
.nav-links.scrolling-tabs
%li
{
class:
(
'active'
if
@scope
==
'
enabled
'
)
}
>
=
link_to
project_clusters_path
(
@project
,
scope: :
enabled
),
class:
"js-active-tab"
do
%li
{
class:
(
'active'
if
@scope
==
'
active
'
)
}
>
=
link_to
project_clusters_path
(
@project
,
scope: :
active
),
class:
"js-active-tab"
do
=
s_
(
"ClusterIntegration|Active"
)
%span
.badge
=
@active_count
%li
{
class:
(
'active'
if
@scope
==
'disabled'
)
}
>
=
link_to
project_clusters_path
(
@project
,
scope: :disabled
),
class:
"js-inactive-tab
#{
'active'
if
@scope
==
'disabled'
}
"
do
%li
{
class:
(
'active'
if
@scope
==
'inactive'
)
}
>
=
link_to
project_clusters_path
(
@project
,
scope: :inactive
),
class:
"js-inactive-tab"
do
=
s_
(
"ClusterIntegration|Inactive"
)
%span
.badge
=
@inactive_count
%li
{
class:
(
'active'
if
@scope
.
nil?
||
@scope
==
'all'
)
}
>
=
link_to
project_clusters_path
(
@project
,
scope: :all
),
class:
"js-all-tab
#{
'active'
if
@scope
==
'all'
||
@scope
.
nil?
}
"
do
=
link_to
project_clusters_path
(
@project
),
class:
"js-all-tab
"
do
=
s_
(
"ClusterIntegration|All"
)
%span
.badge
=
@all_count
.pull-right.nav-bar-right
...
...
app/views/projects/clusters/index.html.haml
View file @
50d9cc6d
...
...
@@ -2,9 +2,9 @@
-
page_title
"Clusters"
.clusters-container
-
if
@clusters
.
empty?
&&
@scope
==
'all'
-
if
@clusters
.
empty?
&&
(
@scope
.
nil?
||
@scope
==
'all'
)
=
render
"empty_state"
-
elsif
@clusters
.
empty?
&&
@scope
!=
'all'
-
elsif
@clusters
.
empty?
&&
(
!
@scope
.
nil?
||
@scope
!=
'all'
)
=
render
"tabs"
.prepend-top-20.text-center
=
s_
(
"ClusterIntegration|There are no clusters to show"
)
...
...
spec/features/projects/clusters_spec.rb
View file @
50d9cc6d
...
...
@@ -24,11 +24,12 @@ feature 'Clusters', :js do
visit
project_clusters_path
(
project
)
end
it
'
user
sees empty state'
do
it
'sees empty state'
do
expect
(
page
).
to
have_link
(
'Add cluster'
)
expect
(
page
).
to
have_selector
(
'.empty-state'
)
end
context
'when user opens
opens
create on gke page'
do
context
'when user opens create on gke page'
do
before
do
click_link
'Add cluster'
click_link
'Create on GKE'
...
...
@@ -95,6 +96,7 @@ feature 'Clusters', :js do
end
it
'user sees a table with one cluster'
do
# One is the header row, the other the cluster row
expect
(
page
).
to
have_selector
(
'.gl-responsive-table-row'
,
count:
2
)
end
...
...
@@ -120,19 +122,29 @@ feature 'Clusters', :js do
context
'with sucessfull request'
do
it
'user sees updated cluster'
do
page
.
find
(
'.js-toggle-cluster-list'
).
click
wait_for_requests
expect
(
page
).
not_to
have_selector
(
'.is-checked'
)
end
end
context
'with failed request'
do
it
'user sees not update cluster and error message'
do
# Cluster was disabled in the last test
page
.
find
(
'.js-toggle-cluster-list'
).
click
Clusters
::
Cluster
.
last
.
provider
.
make_errored!
(
'Something wrong!'
)
expect
(
page
).
not_to
have_selector
(
'.js-toggle-cluster-list.is-checked'
)
end
end
end
context
'when user clicks on a cluster'
do
before
do
# TODO: Replace with Click on cluster after frontend implements list
visit
project_cluster_path
(
project
,
cluster
)
click_link
cluster
.
name
end
it
'user sees an cluster details page'
do
...
...
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