mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Delete selected line items even if does not lead to order cancellation
This commit is contained in:
@@ -150,6 +150,8 @@ angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $timeout,
|
||||
else
|
||||
Promise.all(LineItems.delete(item) for item in items).then(-> $scope.refreshData())
|
||||
, "js.admin.deleting_item_will_cancel_order")
|
||||
else
|
||||
Promise.all(LineItems.delete(item) for item in lineItemsToDelete).then(-> $scope.refreshData())
|
||||
|
||||
$scope.allBoxesChecked = ->
|
||||
checkedCount = $scope.filteredLineItems.reduce (count,lineItem) ->
|
||||
|
||||
@@ -784,6 +784,23 @@ describe '
|
||||
expect(o2.reload.state).to eq("complete")
|
||||
end.to have_enqueued_mail(Spree::OrderMailer, :cancel_email)
|
||||
end
|
||||
|
||||
it "deletes one line item and do not show any popup if it does not lead to order cancelation" do
|
||||
expect(page).to have_selector "tr#li_#{li1.id}"
|
||||
within("tr#li_#{li1.id} td.bulk") do
|
||||
check "bulk"
|
||||
end
|
||||
|
||||
find("div#bulk-actions-dropdown").click
|
||||
find("div#bulk-actions-dropdown div.menu_item", text: "Delete Selected" ).click
|
||||
|
||||
expect(page).to have_content "Loading orders"
|
||||
|
||||
expect(page).to have_no_selector ".modal"
|
||||
expect(page).to have_no_selector "tr#li_#{li1.id}"
|
||||
expect(page).to have_selector "tr#li_#{li11.id}"
|
||||
expect(o1.reload.state).to eq("complete")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user