Shield external portal jumps (keep EXTERNAL_* for later), serve /nav from static build, and proxy /book + /community to vertical Next apps with Caddy notes. Co-authored-by: Cursor <cursoragent@cursor.com>
22 lines
748 B
JavaScript
22 lines
748 B
JavaScript
/** Product offers self-check */
|
|
import assert from 'node:assert/strict'
|
|
|
|
const offers = [
|
|
{ key: 'free', product_id: '', price_fen: 0, free: true },
|
|
{ key: 'tiktok', product_id: '298', price_fen: 29800, free: false },
|
|
{ key: 'youtube', product_id: '188', price_fen: 18800, free: false },
|
|
{ key: 'nomad', product_id: '49', price_fen: 4900, free: false },
|
|
{ key: 'svip', product_id: '998', price_fen: 99800, free: false },
|
|
]
|
|
|
|
assert.equal(offers.filter((o) => !o.free).length, 4)
|
|
assert.deepEqual(
|
|
offers.filter((o) => !o.free).map((o) => o.product_id),
|
|
['298', '188', '49', '998']
|
|
)
|
|
assert.deepEqual(
|
|
offers.filter((o) => !o.free).map((o) => o.price_fen),
|
|
[29800, 18800, 4900, 99800]
|
|
)
|
|
console.log('product-offers self-test: OK')
|