ываыв
This commit is contained in:
Binary file not shown.
@@ -44,6 +44,14 @@ describe('email templates', () => {
|
|||||||
expect(email.html).toContain('href="https://shop.example.com/me/messages"')
|
expect(email.html).toContain('href="https://shop.example.com/me/messages"')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('renders paid payment status as paid in Russian', () => {
|
||||||
|
const email = renderPaymentStatusChangedEmail({ orderId, paymentStatus: 'paid' })
|
||||||
|
|
||||||
|
expect(email.subject).toBe('Оплата заказа — Оплачен')
|
||||||
|
expect(email.html).toContain('<b>Оплачен</b>')
|
||||||
|
expect(email.html).not.toContain('<b>paid</b>')
|
||||||
|
})
|
||||||
|
|
||||||
it('adds admin orders link to admin order message emails', () => {
|
it('adds admin orders link to admin order message emails', () => {
|
||||||
process.env.CLIENT_PUBLIC_URL = 'https://shop.example.com'
|
process.env.CLIENT_PUBLIC_URL = 'https://shop.example.com'
|
||||||
|
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ export function renderAdminOrderMessageEmail({ orderId, preview }) {
|
|||||||
export function renderPaymentStatusChangedEmail({ orderId, paymentStatus }) {
|
export function renderPaymentStatusChangedEmail({ orderId, paymentStatus }) {
|
||||||
const statusLabels = {
|
const statusLabels = {
|
||||||
pending: 'Ожидает',
|
pending: 'Ожидает',
|
||||||
|
paid: 'Оплачен',
|
||||||
confirmed: 'Подтверждён',
|
confirmed: 'Подтверждён',
|
||||||
rejected: 'Отклонён',
|
rejected: 'Отклонён',
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export function renderOrderMessageTg({ orderId, preview }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function renderPaymentStatusChangedTg({ orderId, paymentStatus }) {
|
export function renderPaymentStatusChangedTg({ orderId, paymentStatus }) {
|
||||||
const labels = { pending: 'Ожидает', confirmed: 'Подтверждён', rejected: 'Отклонён' }
|
const labels = { pending: 'Ожидает', paid: 'Оплачен', confirmed: 'Подтверждён', rejected: 'Отклонён' }
|
||||||
return `💳 Оплата заказа #${orderId.slice(0, 8)}: <b>${labels[paymentStatus] || paymentStatus}</b>`
|
return `💳 Оплата заказа #${orderId.slice(0, 8)}: <b>${labels[paymentStatus] || paymentStatus}</b>`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user