import { describe, expect, it } from 'vitest'
import { pricingFor } from './pricing.ts'

describe('anthropic Opus pricing (regression: $5/$25 from 4.5)', () => {
  const opusNew = ['claude-opus-4-5', 'claude-opus-4-6', 'claude-opus-4-7', 'claude-opus-4-8']

  it.each(opusNew)('%s is $5/$25 per Mtok', (model) => {
    const p = pricingFor('anthropic', model)
    expect(p?.inputCostPerToken).toBe(0.000005)
    expect(p?.outputCostPerToken).toBe(0.000025)
  })

  it('the 1m and date-suffixed variants resolve to the same 4.8 price', () => {
    for (const m of ['claude-opus-4-8[1m]', 'claude-opus-4-8-20260529']) {
      expect(pricingFor('anthropic', m)?.outputCostPerToken).toBe(0.000025)
    }
  })

  it('legacy Opus 4.0 / 4.1 keep the $15/$75 price', () => {
    for (const m of ['claude-opus-4-0', 'claude-opus-4-1']) {
      expect(pricingFor('anthropic', m)?.outputCostPerToken).toBe(0.000075)
    }
  })
})
