diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-14 09:09:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-14 09:09:45 +0300 |
commit | b52c116c9929b21ab71703e50d140fe2c52f99be (patch) | |
tree | 8e6087e59c8c35340041bb9bcd12ce9b6cf4fc59 /spec | |
parent | cd4d8b60a0ab51c6d6075a6b7206f1ddbf6295d3 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
7 files changed, 23 insertions, 24 deletions
diff --git a/spec/features/dashboard/issues_filter_spec.rb b/spec/features/dashboard/issues_filter_spec.rb index 4bd00bd0a80..4d59e1ded3d 100644 --- a/spec/features/dashboard/issues_filter_spec.rb +++ b/spec/features/dashboard/issues_filter_spec.rb @@ -81,14 +81,14 @@ RSpec.describe 'Dashboard Issues filtering', :js do sort_by('Created date') visit_issues(assignee_username: user.username) - expect(find('.issues-filters')).to have_content('Created date') + expect(page).to have_button('Created date') end it 'keeps sorting issues after visiting Projects Issues page' do sort_by('Created date') visit project_issues_path(project) - expect(find('.issues-filters')).to have_content('Created date') + expect(page).to have_button('Created date') end end diff --git a/spec/features/issues/user_sorts_issues_spec.rb b/spec/features/issues/user_sorts_issues_spec.rb index c161e1deb83..48297e9049e 100644 --- a/spec/features/issues/user_sorts_issues_spec.rb +++ b/spec/features/issues/user_sorts_issues_spec.rb @@ -22,11 +22,11 @@ RSpec.describe "User sorts issues" do create(:award_emoji, :upvote, awardable: issue2) sign_in(user) - - visit(project_issues_path(project)) end it 'keeps the sort option' do + visit(project_issues_path(project)) + find('.filter-dropdown-container .dropdown').click page.within('ul.dropdown-menu.dropdown-menu-right li') do @@ -47,11 +47,10 @@ RSpec.describe "User sorts issues" do end it 'sorts by popularity', :js do - find('.filter-dropdown-container .dropdown').click + visit(project_issues_path(project)) - page.within('ul.dropdown-menu.dropdown-menu-right li') do - click_link("Popularity") - end + click_button 'Created date' + click_on 'Popularity' page.within(".issues-list") do page.within("li.issue:nth-child(1)") do @@ -129,7 +128,7 @@ RSpec.describe "User sorts issues" do it 'filters by none' do visit project_issues_path(project, due_date: Issue::NoDueDate.name) - page.within '.issues-holder' do + page.within '.issues-list' do expect(page).not_to have_content('foo') expect(page).not_to have_content('bar') expect(page).to have_content('baz') @@ -139,7 +138,7 @@ RSpec.describe "User sorts issues" do it 'filters by any' do visit project_issues_path(project, due_date: Issue::AnyDueDate.name) - page.within '.issues-holder' do + page.within '.issues-list' do expect(page).to have_content('foo') expect(page).to have_content('bar') expect(page).to have_content('baz') @@ -153,7 +152,7 @@ RSpec.describe "User sorts issues" do visit project_issues_path(project, due_date: Issue::DueThisWeek.name) - page.within '.issues-holder' do + page.within '.issues-list' do expect(page).to have_content('foo') expect(page).to have_content('bar') expect(page).not_to have_content('baz') @@ -167,7 +166,7 @@ RSpec.describe "User sorts issues" do visit project_issues_path(project, due_date: Issue::DueThisMonth.name) - page.within '.issues-holder' do + page.within '.issues-list' do expect(page).to have_content('foo') expect(page).to have_content('bar') expect(page).not_to have_content('baz') @@ -181,7 +180,7 @@ RSpec.describe "User sorts issues" do visit project_issues_path(project, due_date: Issue::Overdue.name) - page.within '.issues-holder' do + page.within '.issues-list' do expect(page).not_to have_content('foo') expect(page).not_to have_content('bar') expect(page).to have_content('baz') @@ -195,7 +194,7 @@ RSpec.describe "User sorts issues" do visit project_issues_path(project, due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name) - page.within '.issues-holder' do + page.within '.issues-list' do expect(page).not_to have_content('foo') expect(page).not_to have_content('bar') expect(page).to have_content('baz') diff --git a/spec/features/merge_requests/user_sorts_merge_requests_spec.rb b/spec/features/merge_requests/user_sorts_merge_requests_spec.rb index 54c9fbef218..99473f3b1ea 100644 --- a/spec/features/merge_requests/user_sorts_merge_requests_spec.rb +++ b/spec/features/merge_requests/user_sorts_merge_requests_spec.rb @@ -60,7 +60,7 @@ RSpec.describe 'User sorts merge requests' do visit(project_issues_path(project)) - expect(find('.issues-filters a.is-active')).not_to have_content('Milestone') + expect(page).not_to have_button('Milestone') end context 'when merge requests have awards' do diff --git a/spec/frontend/lib/utils/datetime/timeago_utility_spec.js b/spec/frontend/lib/utils/datetime/timeago_utility_spec.js index 5cffe3ef2b0..2314ec678d3 100644 --- a/spec/frontend/lib/utils/datetime/timeago_utility_spec.js +++ b/spec/frontend/lib/utils/datetime/timeago_utility_spec.js @@ -1,4 +1,3 @@ -import $ from 'jquery'; import { getTimeago, localTimeAgo, timeFor } from '~/lib/utils/datetime/timeago_utility'; import { s__ } from '~/locale'; import '~/commons/bootstrap'; @@ -81,16 +80,16 @@ describe('TimeAgo utils', () => { `With User Setting timeDisplayRelative: $timeDisplayRelative`, ({ timeDisplayRelative, text }) => { it.each` - timeagoArg | title - ${false} | ${'some time'} - ${true} | ${'Feb 18, 2020 10:22pm UTC'} + updateTooltip | title + ${false} | ${'some time'} + ${true} | ${'Feb 18, 2020 10:22pm UTC'} `( - `has content: '${text}' and tooltip: '$title' with timeagoArg = $timeagoArg`, - ({ timeagoArg, title }) => { + `has content: '${text}' and tooltip: '$title' with updateTooltip = $updateTooltip`, + ({ updateTooltip, title }) => { window.gon = { time_display_relative: timeDisplayRelative }; const element = document.querySelector('time'); - localTimeAgo($(element), timeagoArg); + localTimeAgo([element], updateTooltip); jest.runAllTimers(); diff --git a/spec/frontend/pages/admin/users/components/__snapshots__/delete_user_modal_spec.js.snap b/spec/frontend/pages/admin/users/components/__snapshots__/delete_user_modal_spec.js.snap index 4c644a0d05f..5e367891337 100644 --- a/spec/frontend/pages/admin/users/components/__snapshots__/delete_user_modal_spec.js.snap +++ b/spec/frontend/pages/admin/users/components/__snapshots__/delete_user_modal_spec.js.snap @@ -10,6 +10,7 @@ exports[`User Operation confirmation modal renders modal with form included 1`] <oncall-schedules-list-stub schedules="schedule1,schedule2" + username="username" /> <p> diff --git a/spec/frontend/vue_shared/oncall_schedules_list_spec.js b/spec/frontend/vue_shared/oncall_schedules_list_spec.js index 5c30809c09b..f83a5187b8b 100644 --- a/spec/frontend/vue_shared/oncall_schedules_list_spec.js +++ b/spec/frontend/vue_shared/oncall_schedules_list_spec.js @@ -18,7 +18,7 @@ const mockSchedules = [ }, ]; -const userName = 'User 1'; +const userName = "O'User"; describe('On-call schedules list', () => { let wrapper; diff --git a/spec/support/matchers/have_issuable_counts.rb b/spec/support/matchers/have_issuable_counts.rb index 049cfc022fb..586ba0651dc 100644 --- a/spec/support/matchers/have_issuable_counts.rb +++ b/spec/support/matchers/have_issuable_counts.rb @@ -6,7 +6,7 @@ RSpec::Matchers.define :have_issuable_counts do |opts| end match do |actual| - actual.within '.issues-state-filters' do + actual.within '.top-area' do expected_counts.each do |expected_count| expect(actual).to have_content(expected_count) end |