Skip to content

Commit

Permalink
Merge pull request solidusio#4250 from ccarruitero/shipment-split
Browse files Browse the repository at this point in the history
fix backbone shipment item view when split
  • Loading branch information
waiting-for-dev authored Mar 16, 2022
2 parents 6ab74dd + 4df1698 commit d996288
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion backend/app/assets/javascripts/spree/backend/shipments.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ var ShipmentItemView = Backbone.View.extend({
Spree.ajax({
type: "GET",
url: Spree.pathFor('api/variants/' + this.variant_id),
}).success(function(variant){
}).done(function(variant){
var split = new ShipmentSplitItemView({
shipmentItemView: _this,
shipment_number: _this.shipment_number,
Expand Down
20 changes: 20 additions & 0 deletions backend/spec/features/admin/orders/shipments_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,24 @@ def ship_shipment
end
end
end

context "when split shipment", js: true do
let(:location_name) { "WA Warehouse" }
let!(:location) { create(:stock_location, name: location_name)}

it "can split item" do
visit spree.edit_admin_order_path(order)
find_all('.split-item').first.click
within '.stock-item-split' do
find('.save-split').click
alert_text = page.driver.browser.switch_to.alert.text
expect(alert_text).to include 'Please select the split destination'
page.driver.browser.switch_to.alert.accept
find('.select2-container').click
find(:xpath, '//body').all('.select2-drop li.select2-result', text: "#{location_name} (0 on hand)")[1].click
find('.save-split').click
end
expect(page).to have_content /Pending package from '#{location_name}'/i
end
end
end

0 comments on commit d996288

Please sign in to comment.