mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-10-21 05:23:19 +00:00
Claude plan label: read subscriptionType so a Team seat is not shown as Max 5x (#1492)
* quota: Claude plan label prefers the subscription type * desktop: Claude plan label prefers the subscription type * menubar: Claude plan label prefers the subscription type * mac: Claude plan label prefers the subscription type
This commit is contained in:
parent
14c4a52145
commit
42710db3c2
9 changed files with 195 additions and 55 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import { describe, expect, it, vi } from 'vitest'
|
||||
|
||||
import { fetchAntigravityQuota, decodeAntigravitySummary, parseNetstatPorts } from '../src/quota/antigravity.js'
|
||||
import { decodeClaudeUsage, fetchClaudeQuota } from '../src/quota/claude.js'
|
||||
import { decodeClaudeUsage, fetchClaudeQuota, planLabel } from '../src/quota/claude.js'
|
||||
import { decodeCodexUsage, fetchCodexQuota } from '../src/quota/codex.js'
|
||||
import { decodeCopilotUsage, fetchCopilotQuota } from '../src/quota/copilot.js'
|
||||
import { decodeGeminiUsage, fetchGeminiQuota } from '../src/quota/gemini.js'
|
||||
|
|
@ -28,6 +28,23 @@ describe('Claude quota', () => {
|
|||
const result = await fetchClaudeQuota({ fetch: neverFetch as unknown as typeof fetch, readFile: noFile })
|
||||
expect(result.quota.connection).toBe('disconnected')
|
||||
})
|
||||
|
||||
it('prefers subscriptionType over rateLimitTier for the plan label', () => {
|
||||
const cases: Array<[string | undefined, string | undefined, string]> = [
|
||||
['max', 'default_claude_max_20x', 'Max 20x'],
|
||||
['team', 'default_claude_max_5x', 'Team Premium'],
|
||||
['team', undefined, 'Team'],
|
||||
['enterprise', 'default_claude_max_5x', 'Enterprise Premium'],
|
||||
['pro', 'default_claude_pro', 'Pro'],
|
||||
[undefined, 'max_5x', 'Max 5x'],
|
||||
[undefined, 'max_20x', 'Max 20x'],
|
||||
[undefined, 'team', 'Team'],
|
||||
[undefined, undefined, 'Subscription'],
|
||||
]
|
||||
for (const [subscriptionType, rateLimitTier, label] of cases) {
|
||||
expect(planLabel({ subscriptionType, rateLimitTier })).toBe(label)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
describe('Codex quota', () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue