mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-29 21:17:17 +00:00
Highlight voucher on order summary step
This commit is contained in:
committed by
Maikel Linke
parent
856386fcb0
commit
74a8730f04
@@ -85,8 +85,12 @@
|
||||
|
||||
- checkout_adjustments_for(@order, exclude: [:line_item]).reverse_each do |adjustment|
|
||||
.summary-right-line
|
||||
.summary-right-line-label= adjustment.label
|
||||
.summary-right-line-value= adjustment.display_amount.to_html
|
||||
-if adjustment.originator_type == 'Voucher'
|
||||
.summary-right-line-label.voucher= adjustment.label
|
||||
.summary-right-line-value.voucher= adjustment.display_amount.to_html
|
||||
-else
|
||||
.summary-right-line-label= adjustment.label
|
||||
.summary-right-line-value= adjustment.display_amount.to_html
|
||||
|
||||
- if @order.total_tax > 0
|
||||
.summary-right-line
|
||||
|
||||
@@ -332,6 +332,10 @@
|
||||
padding-left: 20px;
|
||||
padding-right: 20px;
|
||||
border-right: 1px solid #DDD;
|
||||
|
||||
.voucher {
|
||||
color: $teal-500
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1084,6 +1084,23 @@ describe "As a consumer, I want to checkout my order" do
|
||||
}.to change { order.reload.state }.from("confirmation").to("address")
|
||||
end
|
||||
end
|
||||
|
||||
describe "vouchers" do
|
||||
let(:voucher) { Voucher.create(code: 'some_code', enterprise: distributor) }
|
||||
|
||||
before do
|
||||
# Add voucher to the order
|
||||
voucher.create_adjustment(voucher.code, order)
|
||||
|
||||
visit checkout_step_path(:summary)
|
||||
end
|
||||
|
||||
it "shows the applied voucher" do
|
||||
within ".summary-right" do
|
||||
expect(page).to have_content "some_code"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context "with previous open orders" do
|
||||
|
||||
Reference in New Issue
Block a user