Skip to content

Commit

Permalink
Redmine4.1のテストで失敗する件に対処
Browse files Browse the repository at this point in the history
  • Loading branch information
telegib committed May 1, 2023
1 parent 3f6126d commit ca4829c
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions spec/features/drag_and_drop_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@

# change id: 1, 2, 3, 4 to 4, 1, 2, 3
expect do
first_target.drag_to(last_target)
Redmine::VERSION::STRING < '4.2' ?
page.driver.browser.action.drag_and_drop_by(first_target.native, 0, 90).perform :
first_target.drag_to(last_target)
wait_for_ajax
end.to change {
IssueTemplate.order(:id).pluck(:position).to_a
Expand All @@ -42,7 +44,9 @@
last_target = table.find('tr:nth-child(4) > td.buttons > span')

expect do
second_target.drag_to(last_target)
Redmine::VERSION::STRING < '4.2' ?
page.driver.browser.action.drag_and_drop_by(second_target.native, 0, 60).perform :
second_target.drag_to(last_target)
wait_for_ajax
end.to change {
IssueTemplate.order(:id).pluck(:position).to_a
Expand All @@ -66,7 +70,9 @@
#--------------------------------------------
# change position: 1, 2, 3, 4 to 4, 1, 2, 3
expect do
first_target.drag_to(last_target)
Redmine::VERSION::STRING < '4.2' ?
page.driver.browser.action.drag_and_drop_by(first_target.native, 0, 90).perform :
first_target.drag_to(last_target)
wait_for_ajax
end.to change {
NoteTemplate.reorder(:id).pluck(:position).to_a
Expand All @@ -79,7 +85,9 @@
last_target = table.find('tr:nth-child(4) > td.buttons > span')

expect do
second_target.drag_to(last_target)
Redmine::VERSION::STRING < '4.2' ?
page.driver.browser.action.drag_and_drop_by(second_target.native, 0, 60).perform :
second_target.drag_to(last_target)
wait_for_ajax
end.to change {
NoteTemplate.reorder(:id).pluck(:position).to_a
Expand Down Expand Up @@ -109,7 +117,9 @@
first_target = table.find("tr:nth-child(#{tr_idx.first}) > td.buttons > span")
last_target = table.find("tr:nth-child(#{tr_idx.last}) > td.buttons > span")

first_target.drag_to(last_target)
Redmine::VERSION::STRING < '4.2' ?
page.driver.browser.action.drag_and_drop_by(first_target.native, 0, 30).perform :
first_target.drag_to(last_target)
wait_for_ajax
tr_idx.reverse!
end
Expand All @@ -135,7 +145,9 @@

# change id: 1, 2, 3, 4 to 4, 1, 2, 3
expect do
first_target.drag_to(last_target)
Redmine::VERSION::STRING < '4.2' ?
page.driver.browser.action.drag_and_drop_by(first_target.native, 0, 90).perform :
first_target.drag_to(last_target)
wait_for_ajax
end.to change {
GlobalIssueTemplate.reorder(:id).pluck(:position).to_a
Expand All @@ -146,7 +158,9 @@
last_target = table.find('tr:nth-child(4) > td.buttons > span')

expect do
second_target.drag_to(last_target)
Redmine::VERSION::STRING < '4.2' ?
page.driver.browser.action.drag_and_drop_by(second_target.native, 0, 60).perform :
second_target.drag_to(last_target)
wait_for_ajax
end.to change {
GlobalIssueTemplate.reorder(:id).pluck(:position).to_a
Expand Down

0 comments on commit ca4829c

Please sign in to comment.