diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 13:16:36 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 13:16:36 +0000 |
commit | 311b0269b4eb9839fa63f80c8d7a58f32b8138a0 (patch) | |
tree | 07e7870bca8aed6d61fdcc810731c50d2c40af47 /spec/features/issue_rebalancing_spec.rb | |
parent | 27909cef6c4170ed9205afa7426b8d3de47cbb0c (diff) | |
download | gitlab-ce-311b0269b4eb9839fa63f80c8d7a58f32b8138a0.tar.gz |
Add latest changes from gitlab-org/gitlab@14-5-stable-eev14.5.0-rc42
Diffstat (limited to 'spec/features/issue_rebalancing_spec.rb')
-rw-r--r-- | spec/features/issue_rebalancing_spec.rb | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/spec/features/issue_rebalancing_spec.rb b/spec/features/issue_rebalancing_spec.rb new file mode 100644 index 00000000000..978768270ec --- /dev/null +++ b/spec/features/issue_rebalancing_spec.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'Issue rebalancing' do + let_it_be(:group) { create(:group) } + let_it_be(:project) { create(:project, group: group) } + let_it_be(:user) { create(:user) } + + let(:alert_message_regex) { /Issues are being rebalanced at the moment/ } + + before_all do + create(:issue, project: project) + + group.add_developer(user) + end + + context 'when issue rebalancing is in progress' do + before do + sign_in(user) + + stub_feature_flags(block_issue_repositioning: true) + end + + it 'shows an alert in project boards' do + board = create(:board, project: project) + + visit project_board_path(project, board) + + expect(page).to have_selector('.gl-alert-info', text: alert_message_regex, count: 1) + end + + it 'shows an alert in group boards' do + board = create(:board, group: group) + + visit group_board_path(group, board) + + expect(page).to have_selector('.gl-alert-info', text: alert_message_regex, count: 1) + end + + it 'shows an alert in project issues list with manual sort' do + visit project_issues_path(project, sort: 'relative_position') + + expect(page).to have_selector('.gl-alert-info', text: alert_message_regex, count: 1) + end + + it 'shows an alert in group issues list with manual sort' do + visit issues_group_path(group, sort: 'relative_position') + + expect(page).to have_selector('.gl-alert-info', text: alert_message_regex, count: 1) + end + + it 'does not show an alert in project issues list with other sorts' do + visit project_issues_path(project, sort: 'created_date') + + expect(page).not_to have_selector('.gl-alert-info', text: alert_message_regex) + end + + it 'does not show an alert in group issues list with other sorts' do + visit issues_group_path(group, sort: 'created_date') + + expect(page).not_to have_selector('.gl-alert-info', text: alert_message_regex) + end + end +end |