(overrides: Partial<BillingStateResponse> = {})
| 11 | const billingCommand = billingCommands.find(cmd => cmd.name === 'billing')! |
| 12 | |
| 13 | const ownerState = (overrides: Partial<BillingStateResponse> = {}): BillingStateResponse => ({ |
| 14 | auto_reload: { |
| 15 | enabled: false, |
| 16 | reload_to_display: '—', |
| 17 | reload_to_usd: null, |
| 18 | threshold_display: '—', |
| 19 | threshold_usd: null |
| 20 | }, |
| 21 | balance_display: '$142.50', |
| 22 | balance_usd: '142.5', |
| 23 | can_charge: true, |
| 24 | card: { brand: 'visa', last4: '4242', masked: 'visa ····4242' }, |
| 25 | charge_presets: ['25', '50', '100'], |
| 26 | charge_presets_display: ['$25', '$50', '$100'], |
| 27 | cli_billing_enabled: true, |
| 28 | is_admin: true, |
| 29 | logged_in: true, |
| 30 | max_usd: '10000', |
| 31 | min_usd: '10', |
| 32 | monthly_cap: { |
| 33 | is_default_ceiling: true, |
| 34 | limit_display: '$1000', |
| 35 | limit_usd: '1000', |
| 36 | spent_display: '$180', |
| 37 | spent_this_month_usd: '180' |
| 38 | }, |
| 39 | ok: true, |
| 40 | org_name: 'Acme', |
| 41 | portal_url: 'https://portal/billing?topup=open', |
| 42 | role: 'OWNER', |
| 43 | ...overrides |
| 44 | }) |
| 45 | |
| 46 | const guarded = |
| 47 | <T>(fn: (r: T) => void) => |
no outgoing calls
no test coverage detected