Compose-ready workspace: packages/zappier (rate card, portal, Stripe), packages/verae-zapier-middleware (timestamp + NATS), packages/verae-zapier (CLI app), vendor/zapier-platform, and research/zapier vendor corpus. Gate 0 structure checks pass. Product code and research are not yet wired.
19 lines
575 B
TypeScript
19 lines
575 B
TypeScript
import { computeDelta } from '../src/billing/stripe';
|
|
|
|
describe('computeDelta', () => {
|
|
it('returns the difference when billable exceeds prior', () => {
|
|
expect(computeDelta(800, 500)).toBe(300);
|
|
});
|
|
|
|
it('returns 0 when billable equals prior', () => {
|
|
expect(computeDelta(500, 500)).toBe(0);
|
|
});
|
|
|
|
it('never returns a negative value when billable is below prior', () => {
|
|
expect(computeDelta(300, 500)).toBe(0);
|
|
});
|
|
|
|
it('returns the full billable amount when nothing was reported before', () => {
|
|
expect(computeDelta(500, 0)).toBe(500);
|
|
});
|
|
});
|