Abo-Status eines Kunden fuer alle Mitarbeiter im Team-Eingang
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0fdd13246c
commit
45203284ee
3 files changed
+45
-1
No files matched your search
@@ -67,3 +67,21 @@ test('alle Team-Routen ohne JWT -> 401', async () => {
|
||||
assert.equal(res.status, 401, `${method} ${p}`)
|
||||
}
|
||||
})
|
||||
|
||||
// Etappe 3: Abo-Status fuer alle Mitarbeiter (Kunden-Reiter "Abo & Angebote", Stunden-Pruefung am Ticket)
|
||||
test('abo: Mitarbeiter ohne Admin-Label sieht den Abo-Status', async () => {
|
||||
aw.seed('subscriptions', {
|
||||
$id: 'sub_t', customerId: 'c3', status: 'active', productKey: 'wartung', storageUnits: 1,
|
||||
startedAt: '2026-09-01T10:00:00.000Z', trialEnd: '2026-09-15T00:00:00.000Z', currentPeriodEnd: '2026-11-01T00:00:00.000Z', cancelAt: null,
|
||||
})
|
||||
const res = await rawGet('/api/team/customers/c3/abo', auth)
|
||||
assert.equal(res.status, 200)
|
||||
assert.deepEqual(res.body, {
|
||||
productKey: 'wartung', active: true, status: 'active', storageUnits: 1, startedAt: '2026-09-01T10:00:00.000Z',
|
||||
serviceStart: '2026-09-15T00:00:00.000Z', currentPeriodEnd: '2026-11-01T00:00:00.000Z', cancelAt: null,
|
||||
})
|
||||
assert.deepEqual((await rawGet('/api/team/customers/c4/abo', auth)).body, {
|
||||
productKey: null, active: false, status: null, storageUnits: 0, startedAt: null, serviceStart: null, currentPeriodEnd: null, cancelAt: null,
|
||||
})
|
||||
assert.equal((await rawGet('/api/team/customers/c3/abo')).status, 401)
|
||||
})
|
||||
Reference in new issue
Block a user