diff options
author | Rajat Jain <rjain@gitlab.com> | 2019-06-26 11:29:23 +0300 |
---|---|---|
committer | Kushal Pandya <kushalspandya@gmail.com> | 2019-06-26 11:29:23 +0300 |
commit | 6f448bd17d2e0a0329146d0f36c3d2b79c48bdc2 (patch) | |
tree | feaefb123c083c0b27e76d557edf9160a3b45d2a /spec/features/groups | |
parent | 58eae2d39275fa1b4cca5f39ebac922d62047c17 (diff) |
Bring Manual Ordering on Issue List
On all the issue lists -- Group, Project and Dashboard -- this
change adds a new option for managing the lists.
"Manual Ordering" option is added which when flipped on will allow
an user to drag and drop issues around to create a relative ordering
among them.
Diffstat (limited to 'spec/features/groups')
-rw-r--r-- | spec/features/groups/issues_spec.rb | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/spec/features/groups/issues_spec.rb b/spec/features/groups/issues_spec.rb index 176f4a668ff..2e7525e0513 100644 --- a/spec/features/groups/issues_spec.rb +++ b/spec/features/groups/issues_spec.rb @@ -2,6 +2,7 @@ require 'spec_helper' describe 'Group issues page' do include FilteredSearchHelpers + include DragTo let(:group) { create(:group) } let(:project) { create(:project, :public, group: group)} @@ -99,4 +100,49 @@ describe 'Group issues page' do end end end + + context 'manual ordering' do + let!(:issue1) { create(:issue, project: project, title: 'Issue #1') } + let!(:issue2) { create(:issue, project: project, title: 'Issue #2') } + let!(:issue3) { create(:issue, project: project, title: 'Issue #3') } + + it 'displays all issues' do + visit issues_group_path(group, sort: 'relative_position') + + page.within('.issues-list') do + expect(page).to have_selector('li.issue', count: 3) + end + end + + it 'has manual-ordering css applied' do + visit issues_group_path(group, sort: 'relative_position') + + expect(page).to have_selector('.manual-ordering') + end + + it 'each issue item has a user-can-drag css applied' do + visit issues_group_path(group, sort: 'relative_position') + + page.within('.manual-ordering') do + expect(page).to have_selector('.issue.user-can-drag', count: 3) + end + end + + it 'issues should be draggable and persist order', :js do + visit issues_group_path(group, sort: 'relative_position') + + drag_to(selector: '.manual-ordering', + scrollable: '#board-app', + list_from_index: 0, + from_index: 0, + to_index: 2, + list_to_index: 0) + + page.within('.manual-ordering') do + expect(find('.issue:nth-child(1) .title')).to have_content('Issue #2') + expect(find('.issue:nth-child(2) .title')).to have_content('Issue #1') + expect(find('.issue:nth-child(3) .title')).to have_content('Issue #3') + end + end + end end |