/**
 * Model Info Tests
 * Verifies registration of gemini-3.1-flash-lite-preview in MODEL_INFO and GoogleConfigSchema
 */

import { describe, it, expect } from 'vitest'
import { MODEL_INFO, GoogleConfigSchema } from '../model-info'

describe('gemini-3.1-flash-lite-preview registration', () => {
  it('exists in MODEL_INFO with correct pricing', () => {
    const info = MODEL_INFO['gemini-3.1-flash-lite-preview']
    expect(info).toBeDefined()
    expect(info.inputCostPer1M).toBe(25)
    expect(info.outputCostPer1M).toBe(150)
  })

  it('GoogleConfigSchema validates a config with gemini-3.1-flash-lite-preview', () => {
    const result = GoogleConfigSchema.safeParse({
      model: 'gemini-3.1-flash-lite-preview',
      provider: 'google',
      apiKey: 'test-key'
    })
    expect(result.success).toBe(true)
  })

  it('GoogleConfigSchema validates temperature: 0 for Flash-Lite', () => {
    const result = GoogleConfigSchema.safeParse({
      model: 'gemini-3.1-flash-lite-preview',
      provider: 'google',
      apiKey: 'test-key',
      temperature: 0
    })
    expect(result.success).toBe(true)
  })

  it('GoogleConfigSchema validates temperature: 1 for Flash', () => {
    const result = GoogleConfigSchema.safeParse({
      model: 'gemini-3-flash-preview',
      provider: 'google',
      apiKey: 'test-key',
      temperature: 1
    })
    expect(result.success).toBe(true)
  })

  it('GoogleModel type includes gemini-3.1-flash-lite-preview via MODEL_INFO key check', () => {
    const modelKeys = Object.keys(MODEL_INFO)
    expect(modelKeys).toContain('gemini-3.1-flash-lite-preview')
  })
})
