diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
commit | 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch) | |
tree | 544930fb309b30317ae9797a9683768705d664c4 /spec/features/dashboard | |
parent | 4b1de649d0168371549608993deac953eb692019 (diff) |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'spec/features/dashboard')
-rw-r--r-- | spec/features/dashboard/archived_projects_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/dashboard/group_spec.rb | 3 | ||||
-rw-r--r-- | spec/features/dashboard/merge_requests_spec.rb | 40 | ||||
-rw-r--r-- | spec/features/dashboard/shortcuts_spec.rb | 4 | ||||
-rw-r--r-- | spec/features/dashboard/user_filters_projects_spec.rb | 4 |
5 files changed, 42 insertions, 11 deletions
diff --git a/spec/features/dashboard/archived_projects_spec.rb b/spec/features/dashboard/archived_projects_spec.rb index 9965229a539..1b349fa2276 100644 --- a/spec/features/dashboard/archived_projects_spec.rb +++ b/spec/features/dashboard/archived_projects_spec.rb @@ -36,7 +36,7 @@ RSpec.describe 'Dashboard Archived Project' do end it 'searches archived projects', :js do - click_button 'Last updated' + click_button 'Name' click_link 'Show archived projects' expect(page).to have_link(project.name) diff --git a/spec/features/dashboard/group_spec.rb b/spec/features/dashboard/group_spec.rb index 653a16bbbcc..0b99fed2a2d 100644 --- a/spec/features/dashboard/group_spec.rb +++ b/spec/features/dashboard/group_spec.rb @@ -17,14 +17,11 @@ RSpec.describe 'Dashboard Group' do visit dashboard_groups_path find('.btn-success').click new_name = 'Samurai' - new_description = 'Tokugawa Shogunate' fill_in 'group_name', with: new_name - fill_in 'group_description', with: new_description click_button 'Create group' expect(current_path).to eq group_path(Group.find_by(name: new_name)) expect(page).to have_content(new_name) - expect(page).to have_content(new_description) end end diff --git a/spec/features/dashboard/merge_requests_spec.rb b/spec/features/dashboard/merge_requests_spec.rb index 952a78ec79a..0e76b5478a1 100644 --- a/spec/features/dashboard/merge_requests_spec.rb +++ b/spec/features/dashboard/merge_requests_spec.rb @@ -52,20 +52,29 @@ RSpec.describe 'Dashboard Merge Requests' do end context 'merge requests exist' do + let_it_be(:author_user) { create(:user) } let(:label) { create(:label) } let!(:assigned_merge_request) do create(:merge_request, assignees: [current_user], source_project: project, - author: create(:user)) + author: author_user) + end + + let!(:review_requested_merge_request) do + create(:merge_request, + reviewers: [current_user], + source_branch: 'review', + source_project: project, + author: author_user) end let!(:assigned_merge_request_from_fork) do create(:merge_request, source_branch: 'markdown', assignees: [current_user], target_project: public_project, source_project: forked_project, - author: create(:user)) + author: author_user) end let!(:authored_merge_request) do @@ -94,7 +103,7 @@ RSpec.describe 'Dashboard Merge Requests' do create(:merge_request, source_branch: 'fix', source_project: project, - author: create(:user)) + author: author_user) end before do @@ -111,6 +120,10 @@ RSpec.describe 'Dashboard Merge Requests' do expect(page).not_to have_content(labeled_merge_request.title) end + it 'does not show review requested merge requests' do + expect(page).not_to have_content(review_requested_merge_request.title) + end + it 'shows authored merge requests', :js do reset_filters input_filtered_search("author:=#{current_user.to_reference}") @@ -159,4 +172,25 @@ RSpec.describe 'Dashboard Merge Requests' do expect(find('.issues-filters')).to have_content('Created date') end end + + context 'merge request review', :js do + let_it_be(:author_user) { create(:user) } + let!(:review_requested_merge_request) do + create(:merge_request, + reviewers: [current_user], + source_branch: 'review', + source_project: project, + author: author_user) + end + + before do + visit merge_requests_dashboard_path(reviewer_username: current_user.username) + end + + it 'displays review requested merge requests' do + expect(page).to have_content(review_requested_merge_request.title) + + expect_tokens([reviewer_token(current_user.name)]) + end + end end diff --git a/spec/features/dashboard/shortcuts_spec.rb b/spec/features/dashboard/shortcuts_spec.rb index 58352518d43..b2fda28f0ec 100644 --- a/spec/features/dashboard/shortcuts_spec.rb +++ b/spec/features/dashboard/shortcuts_spec.rb @@ -13,7 +13,7 @@ RSpec.describe 'Dashboard shortcuts', :js do visit root_dashboard_path end - it 'Navigate to tabs' do + it 'navigate to tabs' do find('body').send_keys([:shift, 'I']) check_page_title('Issues') @@ -45,7 +45,7 @@ RSpec.describe 'Dashboard shortcuts', :js do visit explore_root_path end - it 'Navigate to tabs' do + it 'navigate to tabs' do find('body').send_keys([:shift, 'G']) find('.nothing-here-block') diff --git a/spec/features/dashboard/user_filters_projects_spec.rb b/spec/features/dashboard/user_filters_projects_spec.rb index 832f50932f4..9fa77d5917d 100644 --- a/spec/features/dashboard/user_filters_projects_spec.rb +++ b/spec/features/dashboard/user_filters_projects_spec.rb @@ -173,11 +173,11 @@ RSpec.describe 'Dashboard > User filters projects' do end end - it 'defaults to "Last updated"', :js do + it 'defaults to "Name"', :js do page.find('.filtered-search-block #filtered-search-sorting-dropdown').click active_sorting_option = page.first('.filtered-search-block #filtered-search-sorting-dropdown .is-active') - expect(active_sorting_option).to have_content 'Last updated' + expect(active_sorting_option).to have_content 'Name' end context 'Sorting by name' do |