From 35de250e228f61e4e79caa4af4bc54d8897ab1ea Mon Sep 17 00:00:00 2001 From: SanttuA Date: Tue, 19 Dec 2023 15:01:20 +0200 Subject: [PATCH] Included order number in reservation order info --- app/i18n/messages/en.json | 1 + app/i18n/messages/fi.json | 1 + app/i18n/messages/sv.json | 1 + app/shared/modals/reservation-info/ReservationOrderInfo.js | 1 + .../modals/reservation-info/ReservationOrderInfo.spec.js | 6 ++++++ 5 files changed, 10 insertions(+) diff --git a/app/i18n/messages/en.json b/app/i18n/messages/en.json index 520b73d58..2a15d4bd5 100644 --- a/app/i18n/messages/en.json +++ b/app/i18n/messages/en.json @@ -75,6 +75,7 @@ "common.ok": "OK", "common.optionsAllLabel": "All", "common.orderDetailsLabel": "Order details", + "common.orderNumber": "Order number", "common.payerInformationLabel": "Payer information", "common.paymentAborted": "Payment aborted", "common.paymentMethod": "Payment method", diff --git a/app/i18n/messages/fi.json b/app/i18n/messages/fi.json index af2c337bc..3064ac0d7 100644 --- a/app/i18n/messages/fi.json +++ b/app/i18n/messages/fi.json @@ -75,6 +75,7 @@ "common.ok": "Valmis", "common.optionsAllLabel": "Kaikki", "common.orderDetailsLabel": "Tilaustiedot", + "common.orderNumber": "Tilausnumero", "common.payerInformationLabel": "Maksajan tiedot", "common.paymentAborted": "Maksu keskeytyi", "common.paymentMethod": "Maksutapa", diff --git a/app/i18n/messages/sv.json b/app/i18n/messages/sv.json index 8ef6293f4..c9d3ceaf3 100644 --- a/app/i18n/messages/sv.json +++ b/app/i18n/messages/sv.json @@ -75,6 +75,7 @@ "common.ok": "OK", "common.optionsAllLabel": "Alla", "common.orderDetailsLabel": "Orderdetaljer", + "common.orderNumber": "Ordernummer", "common.payerInformationLabel": "Betalarens information", "common.paymentAborted": "Betalningen avbröts", "common.paymentMethod": "Betalningsmetod", diff --git a/app/shared/modals/reservation-info/ReservationOrderInfo.js b/app/shared/modals/reservation-info/ReservationOrderInfo.js index 395648595..1b466eb88 100644 --- a/app/shared/modals/reservation-info/ReservationOrderInfo.js +++ b/app/shared/modals/reservation-info/ReservationOrderInfo.js @@ -51,6 +51,7 @@ function ReservationOrderInfo({ {renderInfoRow(t('common.taxesTotal'), `${nonZeroTaxTotal} €`)} {renderInfoRow(t('common.priceTotalLabel'), `${order.price} €`)} {orderPaymentMethod && (renderInfoRow(t('common.paymentMethod'), orderPaymentMethod))} + {renderInfoRow(t('common.orderNumber'), order.id)} ); } diff --git a/app/shared/modals/reservation-info/ReservationOrderInfo.spec.js b/app/shared/modals/reservation-info/ReservationOrderInfo.spec.js index 329491178..2db4895bf 100644 --- a/app/shared/modals/reservation-info/ReservationOrderInfo.spec.js +++ b/app/shared/modals/reservation-info/ReservationOrderInfo.spec.js @@ -18,6 +18,7 @@ describe('shared/modals/reservation-info/ReservationOrderInfo', () => { orderLines: [decamelizeKeys(OrderLine.build({ product: Product.build(), quantity: 1 }))], price: '5.00', paymentMethod: constants.PAYMENT_METHODS.ONLINE, + id: 'test-id', }, renderHeading: () => {}, renderInfoRow: () => {}, @@ -101,6 +102,11 @@ describe('shared/modals/reservation-info/ReservationOrderInfo', () => { expect(renderInfoRow).not.toHaveBeenCalledWith('common.paymentMethod', 'common.paymentMethod.cash'); }); }); + + test('for order id', () => { + getWrapper({ renderInfoRow }); + expect(renderInfoRow).toHaveBeenCalledWith('common.orderNumber', defaultProps.order.id); + }); }); }); });