import { describe, expect, it } from 'vitest'
import type { SupportCase } from './case.js'

describe('SupportCase', () => {
  it('is a type-only host contract with optional SLA fields', () => {
    const hostTicket: SupportCase = {
      id: 't-1',
      status: 'open',
      priority: 'high',
      slaBreached: false,
    }

    expect(hostTicket.id).toBe('t-1')
  })

  it('does not emit runtime SupportCase symbols in the built bundle', async () => {
    const { build } = await import('esbuild')
    const entry = new URL('./index.ts', import.meta.url).pathname
    const result = await build({
      entryPoints: [entry],
      bundle: true,
      write: false,
      format: 'esm',
      platform: 'neutral',
    })

    const bundle = result.outputFiles[0]?.text ?? ''
    expect(bundle).not.toMatch(/\bSupportCase\b/)
  })
})
