blob: 7f49d20c83e58de0b36071b837b97b016275db7c (
plain)
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
# frozen_string_literal: true
RSpec.shared_examples 'multiple issue boards' do
context 'authorized user' do
before do
stub_feature_flags(board_new_list: false)
parent.add_maintainer(user)
login_as(user)
visit boards_path
wait_for_requests
end
it 'shows current board name' do
page.within('.boards-switcher') do
expect(page).to have_content(board.name)
end
end
it 'shows a list of boards' do
in_boards_switcher_dropdown do
expect(page).to have_content(board.name)
expect(page).to have_content(board2.name)
end
end
it 'switches current board' do
in_boards_switcher_dropdown do
click_link board2.name
end
wait_for_requests
page.within('.boards-switcher') do
expect(page).to have_content(board2.name)
end
end
it 'creates new board without detailed configuration' do
in_boards_switcher_dropdown do
click_button 'Create new board'
end
fill_in 'board-new-name', with: 'This is a new board'
click_button 'Create board'
wait_for_requests
expect(page).to have_button('This is a new board')
end
it 'deletes board', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/280554' do
in_boards_switcher_dropdown do
click_button 'Delete board'
end
expect(page).to have_content('Are you sure you want to delete this board?')
click_button 'Delete'
wait_for_requests
in_boards_switcher_dropdown do
expect(page).not_to have_content(board.name)
expect(page).to have_content(board2.name)
end
end
it 'adds a list to the none default board' do
in_boards_switcher_dropdown do
click_link board2.name
end
wait_for_requests
page.within('.boards-switcher') do
expect(page).to have_content(board2.name)
end
click_button 'Add list'
wait_for_requests
page.within '.dropdown-menu-issues-board-new' do
click_link planning.title
end
wait_for_requests
expect(page).to have_selector('.board', count: 3)
in_boards_switcher_dropdown do
click_link board.name
end
wait_for_requests
expect(page).to have_selector('.board', count: 2)
end
it 'maintains sidebar state over board switch' do
assert_boards_nav_active
in_boards_switcher_dropdown do
click_link board2.name
end
assert_boards_nav_active
end
end
context 'unauthorized user' do
before do
visit boards_path
wait_for_requests
end
it 'does not show action links' do
in_boards_switcher_dropdown do
expect(page).not_to have_content('Create new board')
expect(page).not_to have_content('Delete board')
end
end
end
def in_boards_switcher_dropdown
find('.boards-switcher').click
wait_for_requests
dropdown_selector = '.js-boards-selector .dropdown-menu'
page.within(dropdown_selector) do
yield
end
end
def assert_boards_nav_active
expect(find('.nav-sidebar .active .active')).to have_selector('a', text: 'Boards')
end
end
|