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:
Diffstat (limited to 'spec/features/issue_rebalancing_spec.rb')
-rw-r--r--spec/features/issue_rebalancing_spec.rb65
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