Fix broken tests
This commit is contained in:
parent
e89fad5246
commit
50d9cc6d1d
3 changed files with 23 additions and 12 deletions
|
@ -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
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue