diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-20 08:43:02 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-20 08:43:02 +0000 |
commit | d9ab72d6080f594d0b3cae15f14b3ef2c6c638cb (patch) | |
tree | 2341ef426af70ad1e289c38036737e04b0aa5007 /spec/features/groups/dependency_proxy_spec.rb | |
parent | d6e514dd13db8947884cd58fe2a9c2a063400a9b (diff) | |
download | gitlab-ce-14.4.0-rc42.tar.gz |
Add latest changes from gitlab-org/gitlab@14-4-stable-eev14.4.0-rc42
Diffstat (limited to 'spec/features/groups/dependency_proxy_spec.rb')
-rw-r--r-- | spec/features/groups/dependency_proxy_spec.rb | 50 |
1 files changed, 27 insertions, 23 deletions
diff --git a/spec/features/groups/dependency_proxy_spec.rb b/spec/features/groups/dependency_proxy_spec.rb index 51371ddc532..d6b0bdc8ea4 100644 --- a/spec/features/groups/dependency_proxy_spec.rb +++ b/spec/features/groups/dependency_proxy_spec.rb @@ -3,13 +3,14 @@ require 'spec_helper' RSpec.describe 'Group Dependency Proxy' do - let(:developer) { create(:user) } + let(:owner) { create(:user) } let(:reporter) { create(:user) } let(:group) { create(:group) } let(:path) { group_dependency_proxy_path(group) } + let(:settings_path) { group_settings_packages_and_registries_path(group) } before do - group.add_developer(developer) + group.add_owner(owner) group.add_reporter(reporter) enable_feature @@ -22,42 +23,46 @@ RSpec.describe 'Group Dependency Proxy' do visit path - expect(page).not_to have_css('.js-dependency-proxy-toggle-area') - expect(page).not_to have_css('.js-dependency-proxy-url') + expect(page).not_to have_css('[data-testid="proxy-url"]') end end context 'feature is available', :js do - context 'when logged in as group developer' do + context 'when logged in as group owner' do before do - sign_in(developer) - visit path + sign_in(owner) end it 'sidebar menu is open' do + visit path + sidebar = find('.nav-sidebar') expect(sidebar).to have_link _('Dependency Proxy') end it 'toggles defaults to enabled' do - page.within('.js-dependency-proxy-toggle-area') do - expect(find('.js-project-feature-toggle-input', visible: false).value).to eq('true') - end + visit path + + expect(page).to have_css('[data-testid="proxy-url"]') end it 'shows the proxy URL' do - page.within('.edit_dependency_proxy_group_setting') do - expect(find('.js-dependency-proxy-url').value).to have_content('/dependency_proxy/containers') - end + visit path + + expect(find('input[data-testid="proxy-url"]').value).to have_content('/dependency_proxy/containers') end it 'hides the proxy URL when feature is disabled' do - page.within('.edit_dependency_proxy_group_setting') do - find('.js-project-feature-toggle').click - end + visit settings_path + wait_for_requests + + click_button 'Enable Proxy' + + expect(page).to have_button 'Enable Proxy', class: '!is-checked' + + visit path - expect(page).not_to have_css('.js-dependency-proxy-url') - expect(find('.js-project-feature-toggle-input', visible: false).value).to eq('false') + expect(page).not_to have_css('input[data-testid="proxy-url"]') end end @@ -68,18 +73,17 @@ RSpec.describe 'Group Dependency Proxy' do end it 'does not show the feature toggle but shows the proxy URL' do - expect(page).not_to have_css('.js-dependency-proxy-toggle-area') - expect(find('.js-dependency-proxy-url').value).to have_content('/dependency_proxy/containers') + expect(find('input[data-testid="proxy-url"]').value).to have_content('/dependency_proxy/containers') end end end context 'feature is not avaible' do before do - sign_in(developer) + sign_in(owner) end - context 'feature flag is disabled' do + context 'feature flag is disabled', :js do before do stub_feature_flags(dependency_proxy_for_private_groups: false) end @@ -90,7 +94,7 @@ RSpec.describe 'Group Dependency Proxy' do it 'informs user that feature is only available for public groups' do visit path - expect(page).to have_content('Dependency proxy feature is limited to public groups for now.') + expect(page).to have_content('Dependency Proxy feature is limited to public groups for now.') end end end |