Skip to content

Commit

Permalink
Requested changes on spec
Browse files Browse the repository at this point in the history
 - if possible no sleep in spec
  • Loading branch information
cyrillefr committed Jun 3, 2024
1 parent 073dfc4 commit 9495d62
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions spec/system/admin/order_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -179,17 +179,15 @@ def new_order_with_distribution(distributor, order_cycle)
login_as_admin
visit spree.edit_admin_order_path(order_with_fees)

transaction_fee = order_with_fees.all_adjustments.payment_fee.eligible.first.amount
adjustment_for_transaction_fee = order_with_fees.all_adjustments.payment_fee.eligible.first
transaction_fee = adjustment_for_transaction_fee.amount

expect(page.find("#order_adjustments").text).to have_content(transaction_fee)

select2_select product.name, from: 'add_variant_id', search: true
find('button.add_variant').click
sleep(1)

new_transaction_fee = order_with_fees.all_adjustments.payment_fee.eligible.first.amount

expect(new_transaction_fee).to be > transaction_fee
expect(page.find("#order_adjustments").text).to have_content(new_transaction_fee)
expect(page).to have_css("#order_adjustments",
text: adjustment_for_transaction_fee.reload.amount)
end
end

Expand Down

0 comments on commit 9495d62

Please sign in to comment.