diff --git a/app/views/split_checkout/_summary.html.haml b/app/views/split_checkout/_summary.html.haml index 692be1510d..e395bd7411 100644 --- a/app/views/split_checkout/_summary.html.haml +++ b/app/views/split_checkout/_summary.html.haml @@ -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 diff --git a/app/webpacker/css/darkswarm/split-checkout.scss b/app/webpacker/css/darkswarm/split-checkout.scss index 49807dc610..3d9c05b929 100644 --- a/app/webpacker/css/darkswarm/split-checkout.scss +++ b/app/webpacker/css/darkswarm/split-checkout.scss @@ -332,6 +332,10 @@ padding-left: 20px; padding-right: 20px; border-right: 1px solid #DDD; + + .voucher { + color: $teal-500 + } } } } diff --git a/spec/system/consumer/split_checkout_spec.rb b/spec/system/consumer/split_checkout_spec.rb index f1b353aee9..6e0378bea1 100644 --- a/spec/system/consumer/split_checkout_spec.rb +++ b/spec/system/consumer/split_checkout_spec.rb @@ -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