diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /spec/features/groups/issues_spec.rb | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'spec/features/groups/issues_spec.rb')
-rw-r--r-- | spec/features/groups/issues_spec.rb | 46 |
1 files changed, 30 insertions, 16 deletions
diff --git a/spec/features/groups/issues_spec.rb b/spec/features/groups/issues_spec.rb index c76e0c311a6..8ecd2beba68 100644 --- a/spec/features/groups/issues_spec.rb +++ b/spec/features/groups/issues_spec.rb @@ -11,11 +11,7 @@ RSpec.describe 'Group issues page' do let(:project_with_issues_disabled) { create(:project, :issues_disabled, group: group) } let(:path) { issues_group_path(group) } - before do - stub_feature_flags(vue_issuables_list: false) - end - - context 'with shared examples' do + context 'with shared examples', :js do let(:issuable) { create(:issue, project: project, title: "this is my created issuable")} include_examples 'project features apply to issuables', Issue @@ -30,19 +26,33 @@ RSpec.describe 'Group issues page' do user_in_group end - it_behaves_like "it has an RSS button with current_user's feed token" it_behaves_like "an autodiscoverable RSS feed with current_user's feed token" + + # Note: The one from rss_shared_example.rb uses a css pseudo-class `:has` + # which is VERY experimental and only supported in Nokogiri used by Capybara + # However,`:js` option forces Capybara to use Selenium that doesn't support`:has` + context "it has an RSS button with current_user's feed token" do + it "shows the RSS button with current_user's feed token" do + expect(find('[data-testid="rss-feed-link"]')['href']).to have_content(user.feed_token) + end + end end context 'when signed out' do let(:user) { nil } - it_behaves_like "it has an RSS button without a feed token" it_behaves_like "an autodiscoverable RSS feed without a feed token" + + # Note: please see the above + context "it has an RSS button without a feed token" do + it "shows the RSS button without a feed token" do + expect(find('[data-testid="rss-feed-link"]')['href']).not_to have_content('feed_token') + end + end end end - context 'assignee', :js do + context 'assignee' do let(:access_level) { ProjectFeature::ENABLED } let(:user) { user_in_group } let(:user2) { user_outside_group } @@ -56,7 +66,7 @@ RSpec.describe 'Group issues page' do end end - context 'issues list' do + context 'issues list', :js do let(:subgroup) { create(:group, parent: group) } let(:subgroup_project) { create(:project, :public, group: subgroup)} let(:user_in_group) { create(:group_member, :maintainer, user: create(:user), group: group ).user } @@ -100,8 +110,6 @@ RSpec.describe 'Group issues page' do find('.empty-state .js-lazy-loaded') find('.new-project-item-link').click - find('.select2-input').set(group.name) - page.within('.select2-results') do expect(page).to have_content(project.full_name) expect(page).not_to have_content(project_with_issues_disabled.full_name) @@ -110,7 +118,7 @@ RSpec.describe 'Group issues page' do end end - context 'manual ordering' do + context 'manual ordering', :js do let(:user_in_group) { create(:group_member, :maintainer, user: create(:user), group: group ).user } let!(:issue1) { create(:issue, project: project, title: 'Issue #1', relative_position: 1) } @@ -143,9 +151,11 @@ RSpec.describe 'Group issues page' do end end - it 'issues should be draggable and persist order', :js do + it 'issues should be draggable and persist order' do visit issues_group_path(group, sort: 'relative_position') + wait_for_requests + drag_to(selector: '.manual-ordering', from_index: 0, to_index: 2) @@ -159,11 +169,13 @@ RSpec.describe 'Group issues page' do check_issue_order end - it 'issues should not be draggable when user is not logged in', :js do + it 'issues should not be draggable when user is not logged in' do sign_out(user_in_group) visit issues_group_path(group, sort: 'relative_position') + wait_for_requests + drag_to(selector: '.manual-ordering', from_index: 0, to_index: 2) @@ -187,7 +199,7 @@ RSpec.describe 'Group issues page' do end end - context 'issues pagination' do + context 'issues pagination', :js do let(:user_in_group) { create(:group_member, :maintainer, user: create(:user), group: group ).user } let!(:issues) do @@ -204,7 +216,9 @@ RSpec.describe 'Group issues page' do end it 'first pagination item is active' do - expect(page).to have_css(".js-first-button a.page-link.active") + page.within('.gl-pagination') do + expect(find('.active')).to have_content('1') + end end end end |