import { describe, expect, it } from 'vitest'
import {
  STATUS_VALUES,
  type GetTranslationsArgs,
  type Language,
} from './model.js'

describe('i18n-content model', () => {
  it('STATUS_VALUES includes OK, STALE, and FAILED', () => {
    expect(STATUS_VALUES).toContain('OK')
    expect(STATUS_VALUES).toContain('STALE')
    expect(STATUS_VALUES).toContain('FAILED')
  })

  it('STATUS_VALUES has length 3', () => {
    expect(STATUS_VALUES.length).toBe(3)
  })

  it('GetTranslationsArgs compiles with optional fields omitted', () => {
    const args: GetTranslationsArgs = {
      entityType: 'post',
      entityId: '1',
      locale: 'en',
    }
    expect(args.entityType).toBe('post')
  })

  it('Language compiles with nullable fields', () => {
    const language: Language = {
      code: 'en',
      nameNative: null,
      nameEnglish: null,
      direction: null,
      searchConfig: null,
      isActive: true,
      isDefault: true,
      sortOrder: 0,
      createdAt: new Date(),
      updatedAt: new Date(),
    }
    expect(language.nameNative).toBeNull()
  })
})
