File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
admin/lib/solidus_admin/testing_support/shared_examples Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 2222RSpec . shared_examples_for "features: sortable" do
2323 let ( :factory_attrs ) { { } }
2424 let ( :scope ) { "body" }
25+ let ( :handle ) { nil }
2526
2627 before do
2728 create ( factory , displayed_attribute => "First" , position : 1 , **factory_attrs )
3536 expect ( find ( "[data-controller='sortable']" ) . all ( :xpath , "./*" ) . last ) . to have_text ( "Second" )
3637
3738 rows = find ( "[data-controller='sortable']" ) . all ( :xpath , "./*" )
38- rows [ 1 ] . drag_to rows [ 0 ]
39+ target = rows [ 0 ]
40+ source = rows [ 1 ]
41+ source = source . find ( handle ) if handle
42+ source . drag_to target
3943
4044 expect ( find ( "[data-controller='sortable']" ) . all ( :xpath , "./*" ) . first ) . to have_text ( "Second" )
4145 expect ( find ( "[data-controller='sortable']" ) . all ( :xpath , "./*" ) . last ) . to have_text ( "First" )
You can’t perform that action at this time.
0 commit comments