1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Issue rebalancing', feature_category: :team_planning 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', :js 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', :js 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
|