Initial import of zappier-edge from zapier monorepo
This commit is contained in:
commit
d6b86e4284
120 changed files with 19867 additions and 0 deletions
19
tests/billing-delta.test.ts
Normal file
19
tests/billing-delta.test.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
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);
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue