feat: show current-cycle token totals
This commit is contained in:
@@ -24,6 +24,29 @@ describe("API decoders", () => {
|
||||
expect(value.account.email).toBeNull();
|
||||
});
|
||||
|
||||
it("解码当前重置周期 Token 合计", () => {
|
||||
const value = decodeDashboard({
|
||||
accountId: 1,
|
||||
displayName: "个人账号",
|
||||
account: { email: "user@example.com", planType: "plus", connected: true },
|
||||
limits: [],
|
||||
currentCycle: {
|
||||
limitId: "codex",
|
||||
windowType: "secondary",
|
||||
windowDurationMinutes: 10080,
|
||||
startedAt: 1_900_000_000,
|
||||
resetsAt: 1_900_604_800,
|
||||
totalTokens: 123_456,
|
||||
},
|
||||
summary: {},
|
||||
usage: [],
|
||||
fetchedAt: 1_900_000_000,
|
||||
stale: false,
|
||||
});
|
||||
expect(value.currentCycle?.windowType).toBe("secondary");
|
||||
expect(value.currentCycle?.totalTokens).toBe(123_456);
|
||||
});
|
||||
|
||||
it("拒绝未知主题", () => {
|
||||
expect(() =>
|
||||
decodeGeneral({
|
||||
|
||||
Reference in New Issue
Block a user