Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-05-19 10:33:21 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-05-19 10:33:21 +0300
commit36a59d088eca61b834191dacea009677a96c052f (patch)
treee4f33972dab5d8ef79e3944a9f403035fceea43f /spec/features/dashboard
parenta1761f15ec2cae7c7f7bbda39a75494add0dfd6f (diff)
Add latest changes from gitlab-org/gitlab@15-0-stable-eev15.0.0-rc42
Diffstat (limited to 'spec/features/dashboard')
-rw-r--r--spec/features/dashboard/issuables_counter_spec.rb5
-rw-r--r--spec/features/dashboard/issues_filter_spec.rb4
-rw-r--r--spec/features/dashboard/merge_requests_spec.rb15
-rw-r--r--spec/features/dashboard/todos/todos_sorting_spec.rb22
-rw-r--r--spec/features/dashboard/todos/todos_spec.rb4
5 files changed, 35 insertions, 15 deletions
diff --git a/spec/features/dashboard/issuables_counter_spec.rb b/spec/features/dashboard/issuables_counter_spec.rb
index aa445265eec..f8b68be7f93 100644
--- a/spec/features/dashboard/issuables_counter_spec.rb
+++ b/spec/features/dashboard/issuables_counter_spec.rb
@@ -53,6 +53,11 @@ RSpec.describe 'Navigation bar counter', :use_clean_rails_memory_store_caching d
describe 'feature flag mr_attention_requests is enabled' do
before do
merge_request.update!(assignees: [user])
+
+ merge_request.find_assignee(user).update!(state: :attention_requested)
+
+ user.invalidate_attention_requested_count
+
sign_in(user)
end
diff --git a/spec/features/dashboard/issues_filter_spec.rb b/spec/features/dashboard/issues_filter_spec.rb
index 4d59e1ded3d..3c774f8b269 100644
--- a/spec/features/dashboard/issues_filter_spec.rb
+++ b/spec/features/dashboard/issues_filter_spec.rb
@@ -78,14 +78,14 @@ RSpec.describe 'Dashboard Issues filtering', :js do
end
it 'remembers last sorting value' do
- sort_by('Created date')
+ pajamas_sort_by(s_('SortOptions|Created date'))
visit_issues(assignee_username: user.username)
expect(page).to have_button('Created date')
end
it 'keeps sorting issues after visiting Projects Issues page' do
- sort_by('Created date')
+ pajamas_sort_by(s_('SortOptions|Created date'))
visit project_issues_path(project)
expect(page).to have_button('Created date')
diff --git a/spec/features/dashboard/merge_requests_spec.rb b/spec/features/dashboard/merge_requests_spec.rb
index 7507ef4e453..fd580b679ad 100644
--- a/spec/features/dashboard/merge_requests_spec.rb
+++ b/spec/features/dashboard/merge_requests_spec.rb
@@ -112,9 +112,12 @@ RSpec.describe 'Dashboard Merge Requests' do
end
it 'includes assigned and reviewers in badge' do
- within("span[aria-label='#{n_("%d merge request", "%d merge requests", 3) % 3}']") do
- expect(page).to have_content('3')
+ within("span[aria-label='#{n_("%d merge request", "%d merge requests", 0) % 0}']") do
+ expect(page).to have_content('0')
end
+
+ find('.dashboard-shortcuts-merge_requests').click
+
expect(find('.js-assigned-mr-count')).to have_content('2')
expect(find('.js-reviewer-mr-count')).to have_content('1')
end
@@ -165,16 +168,16 @@ RSpec.describe 'Dashboard Merge Requests' do
expect(page).to have_content('Please select at least one filter to see results')
end
- it 'shows sorted merge requests' do
- sort_by('Created date')
+ it 'shows sorted merge requests', :js do
+ pajamas_sort_by(s_('SortOptions|Created date'))
visit merge_requests_dashboard_path(assignee_username: current_user.username)
expect(find('.issues-filters')).to have_content('Created date')
end
- it 'keeps sorting merge requests after visiting Projects MR page' do
- sort_by('Created date')
+ it 'keeps sorting merge requests after visiting Projects MR page', :js do
+ pajamas_sort_by(s_('SortOptions|Created date'))
visit project_merge_requests_path(project)
diff --git a/spec/features/dashboard/todos/todos_sorting_spec.rb b/spec/features/dashboard/todos/todos_sorting_spec.rb
index d0f9a2b35f3..d593031590e 100644
--- a/spec/features/dashboard/todos/todos_sorting_spec.rb
+++ b/spec/features/dashboard/todos/todos_sorting_spec.rb
@@ -23,11 +23,12 @@ RSpec.describe 'Dashboard > User sorts todos' do
let!(:merge_request_1) { create(:merge_request, source_project: project, title: 'merge_request_1') }
before do
- create(:todo, user: user, project: project, target: issue_4, created_at: 5.hours.ago)
- create(:todo, user: user, project: project, target: issue_2, created_at: 4.hours.ago)
- create(:todo, user: user, project: project, target: issue_3, created_at: 3.hours.ago)
- create(:todo, user: user, project: project, target: issue_1, created_at: 2.hours.ago)
- create(:todo, user: user, project: project, target: merge_request_1, created_at: 1.hour.ago)
+ create(:todo, user: user, project: project, target: issue_4, created_at: 5.hours.ago, updated_at: 5.hours.ago)
+ create(:todo, user: user, project: project, target: issue_2, created_at: 4.hours.ago, updated_at: 4.hours.ago)
+ create(:todo, user: user, project: project, target: issue_3, created_at: 3.hours.ago, updated_at: 2.minutes.ago)
+ create(:todo, user: user, project: project, target: issue_1, created_at: 2.hours.ago, updated_at: 2.hours.ago)
+ create(:todo, user: user, project: project, target: merge_request_1, created_at: 1.hour.ago,
+ updated_at: 1.hour.ago)
merge_request_1.labels << label_1
issue_3.labels << label_1
@@ -70,6 +71,17 @@ RSpec.describe 'Dashboard > User sorts todos' do
expect(results_list.all('.todo-title')[3]).to have_content('issue_2')
expect(results_list.all('.todo-title')[4]).to have_content('issue_4')
end
+
+ it 'sorts by newest updated todos first' do
+ click_link 'Updated date'
+
+ results_list = page.find('.todos-list')
+ expect(results_list.all('.todo-title')[0]).to have_content('issue_3')
+ expect(results_list.all('.todo-title')[1]).to have_content('merge_request_1')
+ expect(results_list.all('.todo-title')[2]).to have_content('issue_1')
+ expect(results_list.all('.todo-title')[3]).to have_content('issue_2')
+ expect(results_list.all('.todo-title')[4]).to have_content('issue_4')
+ end
end
context 'issues and merge requests' do
diff --git a/spec/features/dashboard/todos/todos_spec.rb b/spec/features/dashboard/todos/todos_spec.rb
index 68d979bb1cf..04e78b59ab4 100644
--- a/spec/features/dashboard/todos/todos_spec.rb
+++ b/spec/features/dashboard/todos/todos_spec.rb
@@ -211,9 +211,9 @@ RSpec.describe 'Dashboard Todos' do
visit dashboard_todos_path
end
- it 'shows you directly addressed yourself message' do
+ it 'shows you directly addressed yourself message being displayed as mentioned yourself' do
page.within('.js-todos-all') do
- expect(page).to have_content("You directly addressed yourself on issue #{issue.to_reference} \"Fix bug\" at #{project.namespace.owner_name} / #{project.name}")
+ expect(page).to have_content("You mentioned yourself on issue #{issue.to_reference} \"Fix bug\" at #{project.namespace.owner_name} / #{project.name}")
expect(page).not_to have_content('to yourself')
end
end