import { describe, it, expect } from 'vitest'

describe('Observability Exports', () => {
  it('exports error tracking types from main package', async () => {
    // Test that types can be imported from the main package
    const {
      ErrorRecordSchema,
      ErrorDetailFullSchema,
      ErrorDistributionSchema,
      ErrorTrendSchema
    } = await import('../index')

    expect(ErrorRecordSchema).toBeDefined()
    expect(ErrorDetailFullSchema).toBeDefined()
    expect(ErrorDistributionSchema).toBeDefined()
    expect(ErrorTrendSchema).toBeDefined()
  })

  it('schemas validate correctly when imported from main package', async () => {
    const { ErrorRecordSchema } = await import('../index')

    const validRecord = {
      id: '123e4567-e89b-12d3-a456-426614174000',
      timestamp: '2024-01-15T10:30:00Z',
      errorType: 'ValidationError',
      message: 'Test error',
      executionId: '223e4567-e89b-12d3-a456-426614174000',
      resourceId: 'workflow-123',
      resourceName: 'Test Workflow',
      severity: 'warning' as const
    }

    const result = ErrorRecordSchema.safeParse(validRecord)
    expect(result.success).toBe(true)
  })
})
