Stripe: Preise je Produkt, Testrabatt Hosting, Kundenportal „Abo verwalten“, Mindestlaufzeit ab termStartAt

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Opus 5.5 committed 2026-09-28 09:21:25 +00:00
1 parent 7799d7c4de
commit e5cc57cefd
7 files changed
+402 -35

No files matched your search

+21 -1
View File
@@ -2,7 +2,7 @@ import { test } from 'node:test'
import assert from 'node:assert/strict'
const { config } = await import('../server/config.js')
const { getProduct, productKeyForLookupKey, describeItems, priceIdsOfInvoice, creditMinutesForInvoice } =
const { getProduct, productKeyForLookupKey, describeItems, priceIdsOfInvoice, creditMinutesForInvoice, termsDocFor, productView } =
await import('../server/services/products.js')
const line = (price, amount, proration = false) => ({
@@ -101,3 +101,23 @@ test('priceIdsOfInvoice: eindeutige Preis-IDs, ohne Lücken', () => {
const inv = { lines: { data: [line('price_w', 5000), line('price_w', -100, true), { amount: 5 }] } }
assert.deepEqual(priceIdsOfInvoice(inv), ['price_w'])
})
test('Vertragsunterlagen je Version', () => {
assert.equal(termsDocFor('2026-10-05-v4').pdfFile, 'WEBklar-Abo-Vertragsunterlagen.pdf')
assert.equal(termsDocFor('2026-09-25-v3').url, '/vertragsunterlagen/v3/abo-bedingungen.html')
assert.equal(termsDocFor(null).url, '/vertragsunterlagen/v3/abo-bedingungen.html')
})
test('Produktansicht enthält Leistungen ohne 1-Postfach-Regel bei Wartung', () => {
const w = productView('wartung').features.flat().join(' ')
assert.ok(w.includes('beliebig viele Postfächer') && !w.includes('1 E-Mail-Postfach'))
assert.ok(productView('hosting').features.flat().join(' ').includes('1 E-Mail-Postfach'))
})
// F07: die Wartungs-Beschreibung darf die alte 1-Postfach-Regel nicht mehr enthalten (Version 4:
// beliebig viele Postfächer, zusammen 5 GB). Der Stripe-Produkttext selbst wird erst beim
// Livegang ueber scripts/stripe-products.mjs gesetzt.
test('Wartung-Beschreibung ohne 1-Postfach-Regel (F07)', () => {
assert.ok(!getProduct('wartung').description.includes('1 E-Mail-Postfach'))
assert.ok(getProduct('wartung').description.includes('beliebig viele Postfächer'))
})