|
|
|
@ -40,13 +40,28 @@ describe 'Manual sorting of WP table', type: :feature, js: true do |
|
|
|
|
FactoryBot.create(:work_package, subject: 'WP1', project: project, type: type_task, created_at: Time.now) |
|
|
|
|
end |
|
|
|
|
let(:work_package_2) do |
|
|
|
|
FactoryBot.create(:work_package, subject: 'WP2', project: project, parent: work_package_1, type: type_task, created_at: Time.now - 1.minutes) |
|
|
|
|
FactoryBot.create(:work_package, |
|
|
|
|
subject: 'WP2', |
|
|
|
|
project: project, |
|
|
|
|
parent: work_package_1, |
|
|
|
|
type: type_task, |
|
|
|
|
created_at: Time.now - 1.minutes) |
|
|
|
|
end |
|
|
|
|
let(:work_package_3) do |
|
|
|
|
FactoryBot.create(:work_package, subject: 'WP3', project: project, parent: work_package_2, type: type_bug, created_at: Time.now - 2.minutes) |
|
|
|
|
FactoryBot.create(:work_package, |
|
|
|
|
subject: 'WP3', |
|
|
|
|
project: project, |
|
|
|
|
parent: work_package_2, |
|
|
|
|
type: type_bug, |
|
|
|
|
created_at: Time.now - 2.minutes) |
|
|
|
|
end |
|
|
|
|
let(:work_package_4) do |
|
|
|
|
FactoryBot.create(:work_package, subject: 'WP4', project: project, parent: work_package_3, type: type_bug, created_at: Time.now - 3.minutes) |
|
|
|
|
FactoryBot.create(:work_package, |
|
|
|
|
subject: 'WP4', |
|
|
|
|
project: project, |
|
|
|
|
parent: work_package_3, |
|
|
|
|
type: type_bug, |
|
|
|
|
created_at: Time.now - 3.minutes) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
let(:sort_by) { ::Components::WorkPackages::SortBy.new } |
|
|
|
@ -122,7 +137,7 @@ describe 'Manual sorting of WP table', type: :feature, js: true do |
|
|
|
|
hierarchies.expect_leaf_at(work_package_3, work_package_4) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it 'can drag an element out of the hierarchy' do |
|
|
|
|
it 'can drag an element completely out of the hierarchy' do |
|
|
|
|
# Move up the hierarchy |
|
|
|
|
wp_table.drag_and_drop_work_package from: 3, to: 0 |
|
|
|
|
loading_indicator_saveguard |
|
|
|
@ -140,6 +155,47 @@ describe 'Manual sorting of WP table', type: :feature, js: true do |
|
|
|
|
hierarchies.expect_leaf_at(work_package_3, work_package_4) |
|
|
|
|
wp_page.expect_no_parent |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context 'drag an element partly out of the hierarchy' do |
|
|
|
|
let(:work_package_5) do |
|
|
|
|
FactoryBot.create(:work_package, subject: 'WP5', project: project, parent: work_package_1) |
|
|
|
|
end |
|
|
|
|
let(:work_package_6) do |
|
|
|
|
FactoryBot.create(:work_package, subject: 'WP6', project: project, parent: work_package_1) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
before do |
|
|
|
|
work_package_5 |
|
|
|
|
work_package_6 |
|
|
|
|
work_package_4.parent = work_package_2 |
|
|
|
|
work_package_4.save! |
|
|
|
|
wp_table.visit! |
|
|
|
|
|
|
|
|
|
# Hierarchy enabled |
|
|
|
|
wp_table.expect_work_package_order(work_package_1, |
|
|
|
|
work_package_2, |
|
|
|
|
work_package_3, |
|
|
|
|
work_package_4, |
|
|
|
|
work_package_5, |
|
|
|
|
work_package_6) |
|
|
|
|
hierarchies.expect_hierarchy_at(work_package_1, work_package_2) |
|
|
|
|
hierarchies.expect_leaf_at(work_package_3, work_package_4, work_package_5, work_package_6) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it 'move below a sibling of my parent' do |
|
|
|
|
wp_table.drag_and_drop_work_package from: 3, to: 5 |
|
|
|
|
|
|
|
|
|
loading_indicator_saveguard |
|
|
|
|
wp_table.expect_work_package_order(work_package_1, |
|
|
|
|
work_package_2, |
|
|
|
|
work_package_3, |
|
|
|
|
work_package_5, |
|
|
|
|
work_package_4, |
|
|
|
|
work_package_6) |
|
|
|
|
hierarchies.expect_hierarchy_at(work_package_1, work_package_2) |
|
|
|
|
hierarchies.expect_leaf_at(work_package_3, work_package_4, work_package_5, work_package_6) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
describe 'group mode' do |
|
|
|
|