Skip to content

Commit

Permalink
Update Spec to force AJAX Error
Browse files Browse the repository at this point in the history
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
  • Loading branch information
cpfergus1 committed Sep 14, 2022
1 parent 6ae4717 commit 42c3a31
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions backend/spec/features/admin/orders/shipments_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 42c3a31

Please sign in to comment.