2019-11-01 17:06:43 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-16 14:09:01 -04:00
|
|
|
RSpec.describe 'Group AWS EKS Cluster', :js do
|
2019-11-01 17:06:43 -04:00
|
|
|
let(:group) { create(:group) }
|
|
|
|
let(:user) { create(:user) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
group.add_maintainer(user)
|
|
|
|
gitlab_sign_in(user)
|
|
|
|
|
|
|
|
allow(Groups::ClustersController).to receive(:STATUS_POLLING_INTERVAL) { 100 }
|
|
|
|
allow_any_instance_of(Clusters::Kubernetes::CreateOrUpdateNamespaceService).to receive(:execute)
|
|
|
|
allow_any_instance_of(Clusters::Cluster).to receive(:retrieve_connection_status).and_return(:connected)
|
2022-03-16 14:08:16 -04:00
|
|
|
stub_application_setting(eks_integration_enabled: true)
|
2019-11-01 17:06:43 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
context 'when user does not have a cluster and visits group clusters page' do
|
|
|
|
before do
|
|
|
|
visit group_clusters_path(group)
|
|
|
|
|
2022-03-28 05:07:06 -04:00
|
|
|
click_button(class: 'dropdown-toggle-split')
|
|
|
|
click_link 'Create a cluster (deprecated)'
|
2019-11-01 17:06:43 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
context 'when user creates a cluster on AWS EKS' do
|
|
|
|
before do
|
|
|
|
click_link 'Amazon EKS'
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'user sees a form to create an EKS cluster' do
|
2022-03-16 14:08:16 -04:00
|
|
|
expect(page).to have_content('Authenticate with Amazon Web Services')
|
2019-11-01 17:06:43 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|