import { describe, it, expect } from 'vitest';
import * as AllinEnums from '../../src/index.js';

describe('枚举常量包导出验证', () => {
  it('应该正确导出所有枚举类型', () => {
    // 验证主要枚举类型
    expect(AllinEnums.DisabilityType).toBeDefined();
    expect(AllinEnums.DisabilityLevel).toBeDefined();
    expect(AllinEnums.OrderStatus).toBeDefined();
    expect(AllinEnums.WorkStatus).toBeDefined();

    // 验证标签映射
    expect(AllinEnums.DisabilityTypeLabels).toBeDefined();
    expect(AllinEnums.DisabilityLevelLabels).toBeDefined();
    expect(AllinEnums.OrderStatusLabels).toBeDefined();
    expect(AllinEnums.WorkStatusLabels).toBeDefined();

    // 验证描述映射
    expect(AllinEnums.OrderStatusDescriptions).toBeDefined();
    expect(AllinEnums.WorkStatusDescriptions).toBeDefined();

    // 验证工具函数
    expect(AllinEnums.getDisabilityTypeLabel).toBeDefined();
    expect(AllinEnums.getDisabilityLevelLabel).toBeDefined();
    expect(AllinEnums.getOrderStatusLabel).toBeDefined();
    expect(AllinEnums.getOrderStatusDescription).toBeDefined();
    expect(AllinEnums.getWorkStatusLabel).toBeDefined();
    expect(AllinEnums.getWorkStatusDescription).toBeDefined();

    // 验证值数组
    expect(AllinEnums.DISABILITY_TYPES).toBeDefined();
    expect(AllinEnums.DISABILITY_LEVELS).toBeDefined();
    expect(AllinEnums.ORDER_STATUSES).toBeDefined();
    expect(AllinEnums.WORK_STATUSES).toBeDefined();
  });

  it('应该能够正确导入和使用枚举值', () => {
    // 测试残疾类型枚举
    expect(AllinEnums.DisabilityType.VISION).toBe('vision');
    expect(AllinEnums.DisabilityTypeLabels[AllinEnums.DisabilityType.VISION]).toBe('视力残疾');
    expect(AllinEnums.getDisabilityTypeLabel(AllinEnums.DisabilityType.VISION)).toBe('视力残疾');

    // 测试残疾等级枚举
    expect(AllinEnums.DisabilityLevel.ONE).toBe(1);
    expect(AllinEnums.DisabilityLevelLabels[AllinEnums.DisabilityLevel.ONE]).toBe('一级');
    expect(AllinEnums.getDisabilityLevelLabel(AllinEnums.DisabilityLevel.ONE)).toBe('一级');

    // 测试订单状态枚举
    expect(AllinEnums.OrderStatus.DRAFT).toBe('draft');
    expect(AllinEnums.OrderStatusLabels[AllinEnums.OrderStatus.DRAFT]).toBe('草稿');
    expect(AllinEnums.getOrderStatusLabel(AllinEnums.OrderStatus.DRAFT)).toBe('草稿');
    expect(AllinEnums.getOrderStatusDescription(AllinEnums.OrderStatus.DRAFT)).toBe('订单已创建但未提交，可继续编辑');

    // 测试工作状态枚举
    expect(AllinEnums.WorkStatus.NOT_WORKING).toBe('not_working');
    expect(AllinEnums.WorkStatusLabels[AllinEnums.WorkStatus.NOT_WORKING]).toBe('未就业');
    expect(AllinEnums.getWorkStatusLabel(AllinEnums.WorkStatus.NOT_WORKING)).toBe('未就业');
    expect(AllinEnums.getWorkStatusDescription(AllinEnums.WorkStatus.NOT_WORKING)).toBe('尚未开始工作，正在寻找就业机会');
  });

  it('应该包含所有预期的导出项', () => {
    const expectedExports = [
      // 残疾类型
      'DisabilityType',
      'DisabilityTypeLabels',
      'getDisabilityTypeLabel',
      'DISABILITY_TYPES',

      // 残疾等级
      'DisabilityLevel',
      'DisabilityLevelLabels',
      'getDisabilityLevelLabel',
      'DISABILITY_LEVELS',

      // 订单状态
      'OrderStatus',
      'OrderStatusLabels',
      'OrderStatusDescriptions',
      'getOrderStatusLabel',
      'getOrderStatusDescription',
      'ORDER_STATUSES',

      // 工作状态
      'WorkStatus',
      'WorkStatusLabels',
      'WorkStatusDescriptions',
      'getWorkStatusLabel',
      'getWorkStatusDescription',
      'WORK_STATUSES'
    ];

    expectedExports.forEach(exportName => {
      expect(AllinEnums).toHaveProperty(exportName);
    });
  });
});