chore: fix prettier formatting

This commit is contained in:
Kirill
2026-05-20 19:33:13 +05:00
parent faac332138
commit 3177413acd
6 changed files with 127 additions and 145 deletions
+5 -15
View File
@@ -166,9 +166,7 @@ describe('yookassa getPayment', () => {
describe('yookassa buildReceipt', () => {
it('builds receipt with order items', () => {
const result = buildReceipt({
orderItems: [
{ titleSnapshot: 'Test Product', qty: 2, priceCentsSnapshot: 100000 },
],
orderItems: [{ titleSnapshot: 'Test Product', qty: 2, priceCentsSnapshot: 100000 }],
deliveryFeeCents: 0,
userEmail: 'user@test.ru',
})
@@ -187,9 +185,7 @@ describe('yookassa buildReceipt', () => {
it('adds delivery item when deliveryFeeCents > 0', () => {
const result = buildReceipt({
orderItems: [
{ titleSnapshot: 'Item A', qty: 1, priceCentsSnapshot: 50000 },
],
orderItems: [{ titleSnapshot: 'Item A', qty: 1, priceCentsSnapshot: 50000 }],
deliveryFeeCents: 35000,
userEmail: 'user@test.ru',
})
@@ -202,9 +198,7 @@ describe('yookassa buildReceipt', () => {
it('passes through taxSystemCode', () => {
const result = buildReceipt({
orderItems: [
{ titleSnapshot: 'Item', qty: 1, priceCentsSnapshot: 1000 },
],
orderItems: [{ titleSnapshot: 'Item', qty: 1, priceCentsSnapshot: 1000 }],
deliveryFeeCents: 0,
userEmail: 'user@test.ru',
taxSystemCode: 3,
@@ -241,15 +235,11 @@ describe('yookassa validateWebhook', () => {
})
it('throws if missing event', () => {
expect(() => validateWebhook('127.0.0.1', { type: 'notification', object: {} })).toThrow(
'Missing event or object',
)
expect(() => validateWebhook('127.0.0.1', { type: 'notification', object: {} })).toThrow('Missing event or object')
})
it('throws if missing object', () => {
expect(() => validateWebhook('127.0.0.1', { type: 'notification', event: 'x' })).toThrow(
'Missing event or object',
)
expect(() => validateWebhook('127.0.0.1', { type: 'notification', event: 'x' })).toThrow('Missing event or object')
})
it('throws for invalid body type', () => {
+1 -1
View File
@@ -124,7 +124,7 @@ function isYookassaIp(ip) {
}
function isTestMode() {
return (process.env.YOOKASSA_SECRET_KEY?.startsWith('test_')) ?? false
return process.env.YOOKASSA_SECRET_KEY?.startsWith('test_') ?? false
}
export function validateWebhook(ip, body) {