diff options
Diffstat (limited to 'spec/features/groups')
-rw-r--r-- | spec/features/groups/empty_states_spec.rb | 4 | ||||
-rw-r--r-- | spec/features/groups/group_runners_spec.rb | 46 | ||||
-rw-r--r-- | spec/features/groups/labels/sort_labels_spec.rb | 4 | ||||
-rw-r--r-- | spec/features/groups/merge_requests_spec.rb | 10 | ||||
-rw-r--r-- | spec/features/groups/milestones_sorting_spec.rb | 4 | ||||
-rw-r--r-- | spec/features/groups/new_group_page_spec.rb | 32 | ||||
-rw-r--r-- | spec/features/groups/settings/repository_spec.rb | 34 |
7 files changed, 119 insertions, 15 deletions
diff --git a/spec/features/groups/empty_states_spec.rb b/spec/features/groups/empty_states_spec.rb index f11e5c56545..84882fc674e 100644 --- a/spec/features/groups/empty_states_spec.rb +++ b/spec/features/groups/empty_states_spec.rb @@ -94,9 +94,7 @@ RSpec.describe 'Group empty states' do end it "shows a new #{issuable_name} button" do - within '.empty-state' do - expect(page).to have_content("create #{issuable_name}") - end + expect(page).to have_content("create #{issuable_name}") end it "the new #{issuable_name} button opens a project dropdown" do diff --git a/spec/features/groups/group_runners_spec.rb b/spec/features/groups/group_runners_spec.rb index ada03726c97..e9807c487d5 100644 --- a/spec/features/groups/group_runners_spec.rb +++ b/spec/features/groups/group_runners_spec.rb @@ -114,6 +114,35 @@ RSpec.describe "Group Runners" do end end + context "with an online instance runner" do + let!(:instance_runner) do + create(:ci_runner, :instance, description: 'runner-baz', contacted_at: Time.zone.now) + end + + before do + visit group_runners_path(group) + end + + context "when selecting 'Show only inherited'" do + before do + find("[data-testid='runner-membership-toggle'] button").click + + wait_for_requests + end + + it_behaves_like 'shows runner in list' do + let(:runner) { instance_runner } + end + + it 'shows runner details page' do + click_link("##{instance_runner.id} (#{instance_runner.short_sha})") + + expect(current_url).to include(group_runner_path(group, instance_runner)) + expect(page).to have_content "#{s_('Runners|Description')} runner-baz" + end + end + end + context 'with a multi-project runner' do let(:project) { create(:project, group: group) } let(:project_2) { create(:project, group: group) } @@ -123,7 +152,7 @@ RSpec.describe "Group Runners" do visit group_runners_path(group) within_runner_row(runner.id) do - expect(page).to have_button 'Delete runner', disabled: true + expect(page).not_to have_button 'Delete runner' end end end @@ -142,6 +171,21 @@ RSpec.describe "Group Runners" do end end end + + describe 'filter by tag' do + let!(:runner_1) { create(:ci_runner, :group, groups: [group], description: 'runner-blue', tag_list: ['blue']) } + let!(:runner_2) { create(:ci_runner, :group, groups: [group], description: 'runner-red', tag_list: ['red']) } + + before do + visit group_runners_path(group) + end + + it_behaves_like 'filters by tag' do + let(:tag) { 'blue' } + let(:found_runner) { runner_1.description } + let(:missing_runner) { runner_2.description } + end + end end describe "Group runner show page", :js do diff --git a/spec/features/groups/labels/sort_labels_spec.rb b/spec/features/groups/labels/sort_labels_spec.rb index fba166449f8..9d05703aae6 100644 --- a/spec/features/groups/labels/sort_labels_spec.rb +++ b/spec/features/groups/labels/sort_labels_spec.rb @@ -28,7 +28,7 @@ RSpec.describe 'Sort labels', :js do it 'sorts by date' do click_button 'Name' - sort_options = find('ul.dropdown-menu').all('li').collect(&:text) + sort_options = find('ul[role="listbox"]').all('li').collect(&:text) expect(sort_options[0]).to eq('Name') expect(sort_options[1]).to eq('Name, descending') @@ -37,7 +37,7 @@ RSpec.describe 'Sort labels', :js do expect(sort_options[4]).to eq('Updated date') expect(sort_options[5]).to eq('Oldest updated') - click_button 'Name, descending' + find('li', text: 'Name, descending').click # assert default sorting within '.other-labels' do diff --git a/spec/features/groups/merge_requests_spec.rb b/spec/features/groups/merge_requests_spec.rb index be1db970e9d..296b839c8fc 100644 --- a/spec/features/groups/merge_requests_spec.rb +++ b/spec/features/groups/merge_requests_spec.rb @@ -57,6 +57,16 @@ RSpec.describe 'Group merge requests page' do expect(find('#js-dropdown-assignee .filter-dropdown')).to have_content(user.name) expect(find('#js-dropdown-assignee .filter-dropdown')).not_to have_content(user2.name) end + + it 'will still show the navbar with no results' do + search_term = 'some-search-term-that-produces-zero-results' + + filtered_search.set(search_term) + filtered_search.send_keys(:enter) + + expect(page).to have_content('filter produced no results') + expect(page).to have_link('Open', href: "/groups/#{group.name}/-/merge_requests?scope=all&search=#{search_term}&state=opened") + end end describe 'new merge request dropdown' do diff --git a/spec/features/groups/milestones_sorting_spec.rb b/spec/features/groups/milestones_sorting_spec.rb index 22d7ff91d41..125bf9ce3a7 100644 --- a/spec/features/groups/milestones_sorting_spec.rb +++ b/spec/features/groups/milestones_sorting_spec.rb @@ -29,9 +29,9 @@ RSpec.describe 'Milestones sorting', :js do within '[data-testid=milestone_sort_by_dropdown]' do click_button 'Due soon' - expect(find('.gl-new-dropdown-contents').all('.gl-new-dropdown-item-text-wrapper p').map(&:text)).to eq(['Due soon', 'Due later', 'Start soon', 'Start later', 'Name, ascending', 'Name, descending']) + expect(find('ul[role="listbox"]').all('li').map(&:text)).to eq(['Due soon', 'Due later', 'Start soon', 'Start later', 'Name, ascending', 'Name, descending']) - click_button 'Due later' + find('li', text: 'Due later').click expect(page).to have_button('Due later') end diff --git a/spec/features/groups/new_group_page_spec.rb b/spec/features/groups/new_group_page_spec.rb new file mode 100644 index 00000000000..6a8af9c31fd --- /dev/null +++ b/spec/features/groups/new_group_page_spec.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'New group page', :js do + let(:user) { create(:user) } + let(:group) { create(:group) } + + before do + sign_in(user) + end + + describe 'new top level group alert' do + context 'when a user visits the new group page' do + it 'shows the new top level group alert' do + visit new_group_path(anchor: 'create-group-pane') + + expect(page).to have_selector('[data-testid="new-top-level-alert"]') + end + end + + context 'when a user visits the new sub group page' do + let(:parent_group) { create(:group) } + + it 'does not show the new top level group alert' do + visit new_group_path(parent_id: parent_group.id, anchor: 'create-group-pane') + + expect(page).not_to have_selector('[data-testid="new-top-level-alert"]') + end + end + end +end diff --git a/spec/features/groups/settings/repository_spec.rb b/spec/features/groups/settings/repository_spec.rb index 159deb2a4e3..f6b8bbdd35f 100644 --- a/spec/features/groups/settings/repository_spec.rb +++ b/spec/features/groups/settings/repository_spec.rb @@ -2,14 +2,17 @@ require 'spec_helper' -RSpec.describe 'Group Repository settings' do +RSpec.describe 'Group Repository settings', :js do include WaitForRequests - let(:user) { create(:user) } - let(:group) { create(:group) } + let_it_be(:user) { create(:user) } + let_it_be(:group, reload: true) { create(:group) } - before do + before_all do group.add_owner(user) + end + + before do sign_in(user) end @@ -20,9 +23,26 @@ RSpec.describe 'Group Repository settings' do stub_container_registry_config(enabled: true) end - it_behaves_like 'a deploy token in settings' do - let(:entity_type) { 'group' } - let(:page_path) { group_settings_repository_path(group) } + context 'when ajax deploy tokens is enabled' do + before do + stub_feature_flags(ajax_new_deploy_token: true) + end + + it_behaves_like 'a deploy token in settings' do + let(:entity_type) { 'group' } + let(:page_path) { group_settings_repository_path(group) } + end + end + + context 'when ajax deploy tokens is disabled' do + before do + stub_feature_flags(ajax_new_deploy_token: false) + end + + it_behaves_like 'a deploy token in settings' do + let(:entity_type) { 'group' } + let(:page_path) { group_settings_repository_path(group) } + end end end |