Skip to content

Commit 9200267

Browse files
liudmylasovetovsViktorSvertoka
authored andcommitted
(SP: 1) [SHOP] fix review feedback for legal copy and test helpers
1 parent 91f7659 commit 9200267

7 files changed

Lines changed: 43 additions & 75 deletions

File tree

frontend/lib/tests/shop/checkout-legal-consent-phase4.test.ts

Lines changed: 8 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import { IdempotencyConflictError } from '@/lib/services/errors';
1313
import { createOrderWithItems } from '@/lib/services/orders';
1414
import { toDbMoney } from '@/lib/shop/money';
1515

16+
import { TEST_LEGAL_CONSENT } from './test-legal-consent';
17+
1618
type SeedProduct = {
1719
productId: string;
1820
};
@@ -94,12 +96,7 @@ describe('checkout legal consent phase 4', () => {
9496
locale: 'en-US',
9597
country: 'US',
9698
items: [{ productId, quantity: 1 }],
97-
legalConsent: {
98-
termsAccepted: true,
99-
privacyAccepted: true,
100-
termsVersion: 'terms-2026-02-27',
101-
privacyVersion: 'privacy-2026-02-27',
102-
},
99+
legalConsent: TEST_LEGAL_CONSENT,
103100
});
104101

105102
orderId = result.order.id;
@@ -152,12 +149,7 @@ describe('checkout legal consent phase 4', () => {
152149
locale: 'en-US',
153150
country: 'US',
154151
items: [{ productId, quantity: 1 }],
155-
legalConsent: {
156-
termsAccepted: true,
157-
privacyAccepted: true,
158-
termsVersion: 'terms-2026-02-27',
159-
privacyVersion: 'privacy-2026-02-27',
160-
},
152+
legalConsent: TEST_LEGAL_CONSENT,
161153
});
162154

163155
orderId = first.order.id;
@@ -223,12 +215,7 @@ describe('checkout legal consent phase 4', () => {
223215
locale: 'en-US',
224216
country: 'US',
225217
items: [{ productId, quantity: 1 }],
226-
legalConsent: {
227-
termsAccepted: true,
228-
privacyAccepted: true,
229-
termsVersion: 'terms-2026-02-27',
230-
privacyVersion: 'privacy-2026-02-27',
231-
},
218+
legalConsent: TEST_LEGAL_CONSENT,
232219
});
233220

234221
orderId = first.order.id;
@@ -243,12 +230,7 @@ describe('checkout legal consent phase 4', () => {
243230
locale: 'en-US',
244231
country: 'US',
245232
items: [{ productId, quantity: 1 }],
246-
legalConsent: {
247-
termsAccepted: true,
248-
privacyAccepted: true,
249-
termsVersion: 'terms-2026-02-27',
250-
privacyVersion: 'privacy-2026-02-27',
251-
},
233+
legalConsent: TEST_LEGAL_CONSENT,
252234
});
253235

254236
expect(replay.isNew).toBe(false);
@@ -287,12 +269,7 @@ describe('checkout legal consent phase 4', () => {
287269
locale: 'en-US',
288270
country: 'US',
289271
items: [{ productId, quantity: 1 }],
290-
legalConsent: {
291-
termsAccepted: true,
292-
privacyAccepted: true,
293-
termsVersion: 'terms-2026-02-27',
294-
privacyVersion: 'privacy-2026-02-27',
295-
},
272+
legalConsent: TEST_LEGAL_CONSENT,
296273
});
297274

298275
orderId = first.order.id;
@@ -317,12 +294,7 @@ describe('checkout legal consent phase 4', () => {
317294
locale: 'en-US',
318295
country: 'US',
319296
items: [{ productId, quantity: 1 }],
320-
legalConsent: {
321-
termsAccepted: true,
322-
privacyAccepted: true,
323-
termsVersion: 'terms-2026-02-27',
324-
privacyVersion: 'privacy-2026-02-27',
325-
},
297+
legalConsent: TEST_LEGAL_CONSENT,
326298
})
327299
).rejects.toMatchObject({
328300
code: 'IDEMPOTENCY_CONFLICT',

frontend/lib/tests/shop/checkout-shipping-phase3.test.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,15 @@ import {
1818
} from '@/lib/services/errors';
1919
import { createOrderWithItems } from '@/lib/services/orders';
2020

21+
import { TEST_LEGAL_CONSENT } from './test-legal-consent';
22+
2123
type SeedData = {
2224
productId: string;
2325
cityRef: string;
2426
warehouseRefA: string;
2527
warehouseRefB: string;
2628
};
2729

28-
const TEST_LEGAL_CONSENT = {
29-
termsAccepted: true,
30-
privacyAccepted: true,
31-
termsVersion: 'terms-2026-02-27',
32-
privacyVersion: 'privacy-2026-02-27',
33-
} as const;
34-
3530
async function seedCheckoutShippingData(): Promise<SeedData> {
3631
const productId = crypto.randomUUID();
3732
const cityRef = crypto.randomUUID();

frontend/lib/tests/shop/order-items-variants.test.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@ import { db } from '@/db';
66
import { orderItems, orders, productPrices, products } from '@/db/schema/shop';
77
import { createOrderWithItems } from '@/lib/services/orders';
88

9-
const TEST_LEGAL_CONSENT = {
10-
termsAccepted: true,
11-
privacyAccepted: true,
12-
termsVersion: 'terms-2026-02-27',
13-
privacyVersion: 'privacy-2026-02-27',
14-
} as const;
9+
import { TEST_LEGAL_CONSENT } from './test-legal-consent';
1510

1611
describe('order_items variants (selected_size/selected_color)', () => {
1712
it('creates two distinct order_items rows for same product with different variants', async () => {
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export const TEST_LEGAL_CONSENT = {
2+
termsAccepted: true,
3+
privacyAccepted: true,
4+
termsVersion: 'terms-2026-02-27',
5+
privacyVersion: 'privacy-2026-02-27',
6+
} as const;

frontend/messages/en.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,8 @@
400400
"shipping": "Shipping",
401401
"shippingCalc": "Calculated at checkout",
402402
"total": "Total",
403-
"shippingInformationalOnly": "Informational only",
404-
"shippingPayOnDeliveryNote": "Shipping is paid to the carrier on delivery; we currently charge only for goods."
403+
"shippingInformationalOnly": "Shown before confirmation",
404+
"shippingPayOnDeliveryNote": "When applicable, the shipping cost is included in the total shown before order confirmation. Additional carrier charges for extra services may still apply separately under the carrier's rules."
405405
},
406406
"delivery": {
407407
"legend": "Delivery",
@@ -1732,7 +1732,7 @@
17321732
"title": "Payment Policy",
17331733
"methods": {
17341734
"title": "Available payment methods",
1735-
"body": "Available payment methods are shown during order checkout. Depending on the order, you may see online card payment via Stripe or a Monobank payment option.",
1735+
"body": "Available payment methods are shown before order confirmation. Depending on the order, you may see online card payment via Stripe or a Monobank payment option.",
17361736
"items": {
17371737
"stripe": "Online card payment via Stripe.",
17381738
"monobank": "Available Monobank payment option."
@@ -1757,7 +1757,7 @@
17571757
"title": "Delivery Policy",
17581758
"methods": {
17591759
"title": "Available delivery methods",
1760-
"body": "Available delivery methods are shown during order checkout for orders that can be delivered.",
1760+
"body": "Available delivery methods are shown before order confirmation for orders that can be delivered.",
17611761
"items": {
17621762
"warehouse": "Nova Poshta warehouse pickup",
17631763
"locker": "Nova Poshta parcel locker pickup",
@@ -1774,7 +1774,7 @@
17741774
},
17751775
"charges": {
17761776
"title": "Delivery charges",
1777-
"body": "The delivery cost for the selected method is shown during order checkout and is added to the order total before order confirmation. Additional carrier charges for extra services requested after order placement, storage beyond the free period, redirection, or other carrier services may be charged separately under the carrier’s own rules."
1777+
"body": "The delivery cost for the selected method is shown before order confirmation and is added to the order total before order confirmation. Additional carrier charges for extra services requested after order placement, storage beyond the free period, redirection, or other carrier services may be charged separately under the carrier’s own rules."
17781778
},
17791779
"support": {
17801780
"title": "Delivery questions",

frontend/messages/pl.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,9 @@
323323
"builtWith": "Zbudowane przez",
324324
"byCommunity": "przez społeczność.",
325325
"sellerInformation": "Informacje o sprzedawcy",
326-
"payment": "Płatność",
327-
"delivery": "Dostawa",
328-
"returns": "Zwroty",
326+
"payment": "Polityka płatności",
327+
"delivery": "Polityka dostawy",
328+
"returns": "Polityka zwrotów",
329329
"privacyPolicy": "Polityka Prywatności",
330330
"termsOfService": "Warunki Świadczenia Usług"
331331
},
@@ -482,13 +482,13 @@
482482
"message": "Zostaniesz przekierowany do bezpiecznej płatności lub zobaczysz potwierdzenie, jeśli płatność nie jest wymagana w tym środowisku",
483483
"notRedirected": "Jeśli nie zostałeś automatycznie przekierowany, otwórz swoje zamówienie",
484484
"goToOrder": "Przejdź do zamówienia",
485-
"consent": {
486-
"prefix": "Zapoznałem(-am) się i akceptuję",
487-
"termsLink": "Warunki świadczenia usług",
488-
"and": "oraz",
489-
"privacyLink": "Politykę prywatności",
490-
"suffix": " dla tego zamówienia.",
491-
"required": "Potwierdź akceptację Warunków świadczenia usług i Polityki prywatności przed złożeniem zamówienia."
485+
"consent": {
486+
"prefix": "Potwierdzam akceptację",
487+
"termsLink": "Warunki świadczenia usług",
488+
"and": "oraz",
489+
"privacyLink": "Politykę prywatności",
490+
"suffix": " dla tego zamówienia.",
491+
"required": "Potwierdź akceptację Warunków świadczenia usług i Polityki prywatności przed złożeniem zamówienia."
492492
},
493493
"errors": {
494494
"unexpectedResponse": "Nieoczekiwana odpowiedź checkout.",
@@ -1711,7 +1711,7 @@
17111711
"lastUpdated": "Ostatnia aktualizacja",
17121712
"seller": {
17131713
"metaTitle": "Informacje o sprzedawcy | Sklep DevLovers",
1714-
"metaDescription": "Publiczne dane sprzedawcy i kontaktowe dla sklepu DevLovers.",
1714+
"metaDescription": "Publiczne dane sprzedawcy i dane kontaktowe sklepu DevLovers.",
17151715
"title": "Informacje o sprzedawcy",
17161716
"sellerDetailsTitle": "Dane sprzedawcy",
17171717
"sellerDetailsBody": "Poniżej znajdują się dane sprzedawcy, które są obecnie opublikowane dla sklepu.",

frontend/messages/uk.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,8 @@
400400
"shipping": "Доставка",
401401
"shippingCalc": "Розраховується при оформленні",
402402
"total": "Всього",
403-
"shippingInformationalOnly": "Лише інформаційно",
404-
"shippingPayOnDeliveryNote": "Доставка оплачується перевізнику при отриманні; зараз списуємо лише товари."
403+
"shippingInformationalOnly": "Показується до підтвердження",
404+
"shippingPayOnDeliveryNote": "Якщо доставка застосовується, її вартість додається під час оформлення замовлення і входить до суми, яку ви бачите до підтвердження замовлення. Додаткові платежі перевізнику за окремі послуги можуть стягуватися окремо за його правилами."
405405
},
406406
"delivery": {
407407
"legend": "Доставка",
@@ -430,7 +430,7 @@
430430
"placeholder": "Почніть вводити назву міста (мін. 2 символи)",
431431
"selected": "Обране місто: {city}",
432432
"searching": "Пошук міст...",
433-
"noResults": "Міста не знайдено. Перевірте назву або локальні дані Nova Poshta."
433+
"noResults": "Міста не знайдено. Перевірте назву або локальні дані Нової пошти."
434434
},
435435
"warehouse": {
436436
"label": "Відділення / поштомат",
@@ -464,15 +464,15 @@
464464
"methodCards": {
465465
"warehouse": {
466466
"title": "Відділення",
467-
"description": "Самовивіз із відділення Nova Poshta"
467+
"description": "Самовивіз із відділення Нової пошти"
468468
},
469469
"locker": {
470470
"title": "Поштомат",
471-
"description": "Самовивіз із поштомату Nova Poshta"
471+
"description": "Самовивіз із поштомата Нової пошти"
472472
},
473473
"courier": {
474474
"title": "Кур’єр",
475-
"description": "Доставка Nova Poshta до дверей"
475+
"description": "Кур’єрська доставка Новою поштою"
476476
}
477477
}
478478
},
@@ -1742,7 +1742,7 @@
17421742
},
17431743
"confirmation": {
17441744
"title": "Коли оплата вважається підтвердженою",
1745-
"body": "Замовлення вважається оплаченим лише після того, як обраний платіжний провайдер підтвердить транзакцію, а магазин збереже цей результат. Сторінка повернення або редирект у браузері самі по собі не є авторитетним підтвердженням оплати."
1745+
"body": "Замовлення вважається оплаченим лише після того, як обраний платіжний провайдер підтвердить транзакцію, а магазин збереже цей результат. Сама сторінка повернення чи перенаправлення в браузері ще не означає, що оплату підтверджено."
17461746
},
17471747
"charges": {
17481748
"title": "Що списується онлайн",
@@ -1761,9 +1761,9 @@
17611761
"title": "Доступні способи доставки",
17621762
"body": "Доступні способи доставки показуються під час оформлення замовлення для замовлень, які можна доставити.",
17631763
"items": {
1764-
"warehouse": "Самовивіз із відділення Nova Poshta",
1765-
"locker": "Самовивіз із поштомата Nova Poshta",
1766-
"courier": "Кур’єрська доставка Nova Poshta"
1764+
"warehouse": "Самовивіз із відділення Нової пошти",
1765+
"locker": "Самовивіз із поштомата Нової пошти",
1766+
"courier": "Кур’єрська доставка Новою поштою"
17671767
}
17681768
},
17691769
"availability": {

0 commit comments

Comments
 (0)