From 42c3a31d79f946f21695908e2bd2c109e8e6e18d Mon Sep 17 00:00:00 2001 From: Connor Ferguson <68167430+cpfergus1@users.noreply.github.com> Date: Wed, 14 Sep 2022 12:08:27 -0600 Subject: [PATCH] Update Spec to force AJAX Error Specs did not catch the deprecated method "error" because there were not any tests that checked for an AJAX error. Added steps to a current current test to ensure an AJAX call fails to cover the method "fail" and "then" incase those methods might be deprecated in the future --- backend/spec/features/admin/orders/shipments_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/spec/features/admin/orders/shipments_spec.rb b/backend/spec/features/admin/orders/shipments_spec.rb index 2043dbbab64..888d812a544 100644 --- a/backend/spec/features/admin/orders/shipments_spec.rb +++ b/backend/spec/features/admin/orders/shipments_spec.rb @@ -157,6 +157,12 @@ def ship_shipment 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('#item_quantity').fill_in(with: 'text') + find('.save-split').click + alert_text = page.driver.browser.switch_to.alert.text + expect(alert_text).to include 'Quantity must be greater than 0' + page.driver.browser.switch_to.alert.accept + find('#item_quantity').fill_in(with: '1') find('.save-split').click end expect(page).to have_content /Pending package from '#{location_name}'/i