31 lines
1.2 KiB
JavaScript
31 lines
1.2 KiB
JavaScript
import { test } from 'node:test'
|
|
import assert from 'node:assert/strict'
|
|
import { schemaKeys } from './support/schema.js'
|
|
|
|
test('bankTransactions: Attribute der Spec sind im Setup-Skript angelegt', () => {
|
|
const keys = schemaKeys('bankTransactions')
|
|
for (const key of ['amountCents', 'category', 'matchedInvoiceId', 'entryReference', 'bookingDate', 'syncedAt']) {
|
|
assert.ok(keys.includes(key), `${key} fehlt`)
|
|
}
|
|
})
|
|
|
|
test('bankConnections: Status und Warnstufen', () => {
|
|
const keys = schemaKeys('bankConnections')
|
|
for (const key of ['status', 'sessionId', 'accountUid', 'validUntil', 'warnedThresholds', 'balanceBookedCents']) {
|
|
assert.ok(keys.includes(key), `${key} fehlt`)
|
|
}
|
|
})
|
|
|
|
test('financeSettings und financeFixedCosts sind angelegt', () => {
|
|
assert.ok(schemaKeys('financeSettings').includes('taxReservePercent'))
|
|
assert.ok(schemaKeys('financeFixedCosts').includes('counterpartyMatch'))
|
|
})
|
|
|
|
test('subscriptions wird weiter aus dem Abo-Setup gelesen', () => {
|
|
assert.ok(schemaKeys('subscriptions').includes('stripeSubscriptionId'))
|
|
})
|
|
|
|
test('unbekannte Collection scheitert mit klarer Meldung', () => {
|
|
assert.throws(() => schemaKeys('gibtEsNicht'), /Collection gibtEsNicht fehlt im Setup-Skript/)
|
|
})
|