Files
orca/src/main/rate-limits/codex-pty-status-parser.test.ts
T
Neil fc0d947983 refactor(rate-limits): split Codex and Claude fetchers (#16140)
* refactor(rate-limits): split Codex and Claude fetchers

* refactor(rate-limits): restore base error-message defaulting

The split moved the 'Unknown error' fallback from inside String() to the call site, which changed behavior for an Error with an empty .message: base surfaced '', head surfaced 'Unknown error'. Restore the base form.
2026-08-25 00:53:44 -07:00

20 lines
587 B
TypeScript

import { describe, expect, it } from 'vitest'
import { parseCodexPtyStatus } from './codex-pty-status-parser'
describe('Codex PTY status parser', () => {
it('uses the account row orientation and reset when a model-scoped weekly row renders first', () => {
const result = parseCodexPtyStatus(
'GPT-5.3-Codex-Spark Weekly limit: 100% left (resets in 1d 2h)\n' +
'Weekly limit: 43% left (resets in 5d 3h)\n'
)
expect(result).toMatchObject({
session: null,
weekly: {
usedPercent: 57,
resetDescription: '5d 3h'
}
})
})
})