Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Add specs to cover sorting behavior in Boards Index Page

Aaron Contreras72a8fb4a92c5
diff --git a/modules/boards/spec/features/board_index_spec.rb b/modules/boards/spec/features/board_index_spec.rb
index 78cd372554d..a32c14cfe61 100644
--- a/modules/boards/spec/features/board_index_spec.rb
+++ b/modules/boards/spec/features/board_index_spec.rb
@@ -135,6 +135,34 @@ RSpec.describe 'Work Package Project Boards Index Page',
end
end
+ describe 'sorting' do
+ it 'allows sorting by "Name" and "Created on"' do
+ # Initial sort is Name ASC
+ # We can assert this behavior by expected the order to be
+ # 1. board_view
+ # 2. other_board_view
+ # upon page load
+ aggregate_failures 'Sorting by Name' do
+ board_index.expect_boards_listed_in_order(board_view,
+ other_board_view)
+
+ board_index.click_to_sort_by('Name')
+ board_index.expect_boards_listed_in_order(other_board_view,
+ board_view)
+ end
+
+ aggregate_failures 'Sorting by Created on' do
+ board_index.click_to_sort_by('Created on')
+ board_index.expect_boards_listed_in_order(board_view,
+ other_board_view)
+
+ board_index.click_to_sort_by('Created on')
+ board_index.expect_boards_listed_in_order(other_board_view,
+ board_view)
+ end
+ end
+ end
+
it 'paginates results', with_settings: { per_page_options: '1' } do
# First page displays the historically last meeting
board_index.expect_boards_listed(board_view)