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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
50d9cc6d
Commit
50d9cc6d
authored
Nov 28, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix broken tests
parent
e89fad52
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
12 deletions
+23
-12
app/views/projects/clusters/_tabs.html.haml
app/views/projects/clusters/_tabs.html.haml
+5
-6
app/views/projects/clusters/index.html.haml
app/views/projects/clusters/index.html.haml
+2
-2
spec/features/projects/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 @@
...
@@ -2,17 +2,16 @@
.fade-left
=
icon
(
"angle-left"
)
.fade-left
=
icon
(
"angle-left"
)
.fade-right
=
icon
(
"angle-right"
)
.fade-right
=
icon
(
"angle-right"
)
%ul
.nav-links.scrolling-tabs
%ul
.nav-links.scrolling-tabs
%li
{
class:
(
'active'
if
@scope
==
'
enabled
'
)
}
>
%li
{
class:
(
'active'
if
@scope
==
'
active
'
)
}
>
=
link_to
project_clusters_path
(
@project
,
scope: :
enabled
),
class:
"js-active-tab"
do
=
link_to
project_clusters_path
(
@project
,
scope: :
active
),
class:
"js-active-tab"
do
=
s_
(
"ClusterIntegration|Active"
)
=
s_
(
"ClusterIntegration|Active"
)
%span
.badge
=
@active_count
%span
.badge
=
@active_count
%li
{
class:
(
'active'
if
@scope
==
'inactive'
)
}
>
%li
{
class:
(
'active'
if
@scope
==
'disabled'
)
}
>
=
link_to
project_clusters_path
(
@project
,
scope: :inactive
),
class:
"js-inactive-tab"
do
=
link_to
project_clusters_path
(
@project
,
scope: :disabled
),
class:
"js-inactive-tab
#{
'active'
if
@scope
==
'disabled'
}
"
do
=
s_
(
"ClusterIntegration|Inactive"
)
=
s_
(
"ClusterIntegration|Inactive"
)
%span
.badge
=
@inactive_count
%span
.badge
=
@inactive_count
%li
{
class:
(
'active'
if
@scope
.
nil?
||
@scope
==
'all'
)
}
>
%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"
)
=
s_
(
"ClusterIntegration|All"
)
%span
.badge
=
@all_count
%span
.badge
=
@all_count
.pull-right.nav-bar-right
.pull-right.nav-bar-right
...
...
app/views/projects/clusters/index.html.haml
View file @
50d9cc6d
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
-
page_title
"Clusters"
-
page_title
"Clusters"
.clusters-container
.clusters-container
-
if
@clusters
.
empty?
&&
@scope
==
'all'
-
if
@clusters
.
empty?
&&
(
@scope
.
nil?
||
@scope
==
'all'
)
=
render
"empty_state"
=
render
"empty_state"
-
elsif
@clusters
.
empty?
&&
@scope
!=
'all'
-
elsif
@clusters
.
empty?
&&
(
!
@scope
.
nil?
||
@scope
!=
'all'
)
=
render
"tabs"
=
render
"tabs"
.prepend-top-20.text-center
.prepend-top-20.text-center
=
s_
(
"ClusterIntegration|There are no clusters to show"
)
=
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
...
@@ -24,11 +24,12 @@ feature 'Clusters', :js do
visit
project_clusters_path
(
project
)
visit
project_clusters_path
(
project
)
end
end
it
'
user
sees empty state'
do
it
'sees empty state'
do
expect
(
page
).
to
have_link
(
'Add cluster'
)
expect
(
page
).
to
have_link
(
'Add cluster'
)
expect
(
page
).
to
have_selector
(
'.empty-state'
)
end
end
context
'when user opens
opens
create on gke page'
do
context
'when user opens create on gke page'
do
before
do
before
do
click_link
'Add cluster'
click_link
'Add cluster'
click_link
'Create on GKE'
click_link
'Create on GKE'
...
@@ -95,6 +96,7 @@ feature 'Clusters', :js do
...
@@ -95,6 +96,7 @@ feature 'Clusters', :js do
end
end
it
'user sees a table with one cluster'
do
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
)
expect
(
page
).
to
have_selector
(
'.gl-responsive-table-row'
,
count:
2
)
end
end
...
@@ -120,19 +122,29 @@ feature 'Clusters', :js do
...
@@ -120,19 +122,29 @@ feature 'Clusters', :js do
context
'with sucessfull request'
do
context
'with sucessfull request'
do
it
'user sees updated cluster'
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
end
end
context
'with failed request'
do
context
'with failed request'
do
it
'user sees not update cluster and error message'
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
end
end
end
context
'when user clicks on a cluster'
do
context
'when user clicks on a cluster'
do
before
do
before
do
# TODO: Replace with Click on cluster after frontend implements list
click_link
cluster
.
name
visit
project_cluster_path
(
project
,
cluster
)
end
end
it
'user sees an cluster details page'
do
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