fix(usage): commandcode monthly total = consumed + remaining credits
This commit is contained in:
@@ -113,9 +113,11 @@ describe("getUsageForProvider(commandcode)", () => {
|
||||
total: 6,
|
||||
resetAt: new Date(1786379982640).toISOString(),
|
||||
});
|
||||
// monthlyCredits/purchasedCredits/freeCredits are remaining balances;
|
||||
// total = consumed (summary.totalCredits) + remaining, matching the CLI.
|
||||
expect(usage.quotas["Monthly credits"]).toMatchObject({
|
||||
used: 0.1,
|
||||
total: 9.9,
|
||||
total: 10,
|
||||
});
|
||||
});
|
||||
|
||||
@@ -194,8 +196,8 @@ describe("parseQuotaData(commandcode)", () => {
|
||||
},
|
||||
"Monthly credits": {
|
||||
used: 0.1,
|
||||
total: 9.9,
|
||||
remainingPercentage: 98.99,
|
||||
total: 10,
|
||||
remainingPercentage: 99,
|
||||
resetAt: null,
|
||||
unit: "$",
|
||||
},
|
||||
@@ -205,14 +207,11 @@ describe("parseQuotaData(commandcode)", () => {
|
||||
name: "5-hour window",
|
||||
used: 0.05,
|
||||
total: 3,
|
||||
remainingPercentage: 98.33,
|
||||
unit: "$",
|
||||
});
|
||||
expect(rows[1]).toMatchObject({
|
||||
name: "Monthly credits",
|
||||
used: 0.1,
|
||||
total: 9.9,
|
||||
remainingPercentage: 98.99,
|
||||
total: 10,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user