summaryrefslogtreecommitdiff
path: root/spec/features/boards/issue_ordering_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/boards/issue_ordering_spec.rb')
-rw-r--r--spec/features/boards/issue_ordering_spec.rb35
1 files changed, 35 insertions, 0 deletions
diff --git a/spec/features/boards/issue_ordering_spec.rb b/spec/features/boards/issue_ordering_spec.rb
index f1ee7a8fde7..8aecaab42c2 100644
--- a/spec/features/boards/issue_ordering_spec.rb
+++ b/spec/features/boards/issue_ordering_spec.rb
@@ -130,6 +130,41 @@ RSpec.describe 'Issue Boards', :js, feature_category: :team_planning do
end
end
+ context 'ordering in list using move to position' do
+ let(:move_to_position) { find('[data-testid="board-move-to-position"]') }
+
+ before do
+ visit project_board_path(project, board)
+ wait_for_requests
+ end
+
+ it 'moves to end of list' do
+ expect(all('.board-card').first).to have_content(issue3.title)
+
+ page.within(find('.board:nth-child(2)')) do
+ first('.board-card').hover
+ move_to_position.click
+
+ click_button 'Move to end of list'
+ end
+
+ expect(all('.board-card').last).to have_content(issue3.title)
+ end
+
+ it 'moves to start of list' do
+ expect(all('.board-card').last).to have_content(issue1.title)
+
+ page.within(find('.board:nth-child(2)')) do
+ all('.board-card').last.hover
+ move_to_position.click
+
+ click_button 'Move to start of list'
+ end
+
+ expect(all('.board-card').first).to have_content(issue1.title)
+ end
+ end
+
context 'ordering when changing list' do
let(:label2) { create(:label, project: project) }
let!(:list2) { create(:list, board: board, label: label2, position: 1) }