ソースを参照

🗑️ chore(tests): 清理枚举包中的测试文件

- 删除已编译的测试文件(.js, .d.ts, .map)以减少仓库体积
- 保留源文件(.ts)以支持后续开发
- 更新根目录 package.json 脚本,将 `dev:allin-enums` 命令添加到 `dev:mini-ui-packages` 并发脚本中
yourname 4 週間 前
コミット
bc9e3df737

+ 0 - 2
allin-packages/enums/tests/unit/enums.test.d.ts

@@ -1,2 +0,0 @@
-export {};
-//# sourceMappingURL=enums.test.d.ts.map

+ 0 - 1
allin-packages/enums/tests/unit/enums.test.d.ts.map

@@ -1 +0,0 @@
-{"version":3,"file":"enums.test.d.ts","sourceRoot":"","sources":["enums.test.ts"],"names":[],"mappings":""}

+ 0 - 122
allin-packages/enums/tests/unit/enums.test.js

@@ -1,122 +0,0 @@
-import { describe, it, expect } from 'vitest';
-import { DisabilityType, DisabilityTypeLabels, DISABILITY_TYPES, DisabilityLevel, DisabilityLevelLabels, DISABILITY_LEVELS, OrderStatus, OrderStatusLabels, OrderStatusDescriptions, ORDER_STATUSES, WorkStatus, WorkStatusLabels, WorkStatusDescriptions, WORK_STATUSES } from '../../src/index.js';
-describe('Allin系统枚举常量', () => {
-    describe('残疾类型枚举 (DisabilityType)', () => {
-        it('应该包含7个有效的残疾类型值', () => {
-            expect(DISABILITY_TYPES).toHaveLength(7);
-            expect(DISABILITY_TYPES).toEqual([
-                DisabilityType.VISION,
-                DisabilityType.HEARING,
-                DisabilityType.SPEECH,
-                DisabilityType.PHYSICAL,
-                DisabilityType.INTELLECTUAL,
-                DisabilityType.MENTAL,
-                DisabilityType.MULTIPLE
-            ]);
-        });
-        it('应该与数据库原始值一致(小写字符串)', () => {
-            expect(DisabilityType.VISION).toBe('vision');
-            expect(DisabilityType.HEARING).toBe('hearing');
-            expect(DisabilityType.SPEECH).toBe('speech');
-            expect(DisabilityType.PHYSICAL).toBe('physical');
-            expect(DisabilityType.INTELLECTUAL).toBe('intellectual');
-            expect(DisabilityType.MENTAL).toBe('mental');
-            expect(DisabilityType.MULTIPLE).toBe('multiple');
-        });
-        it('应该有正确的中文标签映射', () => {
-            expect(DisabilityTypeLabels[DisabilityType.VISION]).toBe('视力残疾');
-            expect(DisabilityTypeLabels[DisabilityType.HEARING]).toBe('听力残疾');
-            expect(DisabilityTypeLabels[DisabilityType.SPEECH]).toBe('言语残疾');
-            expect(DisabilityTypeLabels[DisabilityType.PHYSICAL]).toBe('肢体残疾');
-            expect(DisabilityTypeLabels[DisabilityType.INTELLECTUAL]).toBe('智力残疾');
-            expect(DisabilityTypeLabels[DisabilityType.MENTAL]).toBe('精神残疾');
-            expect(DisabilityTypeLabels[DisabilityType.MULTIPLE]).toBe('多重残疾');
-        });
-    });
-    describe('残疾等级枚举 (DisabilityLevel)', () => {
-        it('应该包含4个有效的残疾等级值', () => {
-            expect(DISABILITY_LEVELS).toHaveLength(4);
-            expect(DISABILITY_LEVELS).toEqual([
-                DisabilityLevel.ONE,
-                DisabilityLevel.TWO,
-                DisabilityLevel.THREE,
-                DisabilityLevel.FOUR
-            ]);
-        });
-        it('应该与数据库原始值一致(数字1-4)', () => {
-            expect(DisabilityLevel.ONE).toBe(1);
-            expect(DisabilityLevel.TWO).toBe(2);
-            expect(DisabilityLevel.THREE).toBe(3);
-            expect(DisabilityLevel.FOUR).toBe(4);
-        });
-        it('应该有正确的中文标签映射', () => {
-            expect(DisabilityLevelLabels[DisabilityLevel.ONE]).toBe('一级');
-            expect(DisabilityLevelLabels[DisabilityLevel.TWO]).toBe('二级');
-            expect(DisabilityLevelLabels[DisabilityLevel.THREE]).toBe('三级');
-            expect(DisabilityLevelLabels[DisabilityLevel.FOUR]).toBe('四级');
-        });
-    });
-    describe('订单状态枚举 (OrderStatus)', () => {
-        it('应该包含5个有效的订单状态值', () => {
-            expect(ORDER_STATUSES).toHaveLength(5);
-            expect(ORDER_STATUSES).toEqual([
-                OrderStatus.DRAFT,
-                OrderStatus.CONFIRMED,
-                OrderStatus.IN_PROGRESS,
-                OrderStatus.COMPLETED,
-                OrderStatus.CANCELLED
-            ]);
-        });
-        it('应该与数据库原始值一致(小写字符串,下划线分隔)', () => {
-            expect(OrderStatus.DRAFT).toBe('draft');
-            expect(OrderStatus.CONFIRMED).toBe('confirmed');
-            expect(OrderStatus.IN_PROGRESS).toBe('in_progress');
-            expect(OrderStatus.COMPLETED).toBe('completed');
-            expect(OrderStatus.CANCELLED).toBe('cancelled');
-        });
-        it('应该有正确的中文标签映射', () => {
-            expect(OrderStatusLabels[OrderStatus.DRAFT]).toBe('草稿');
-            expect(OrderStatusLabels[OrderStatus.CONFIRMED]).toBe('已确认');
-            expect(OrderStatusLabels[OrderStatus.IN_PROGRESS]).toBe('进行中');
-            expect(OrderStatusLabels[OrderStatus.COMPLETED]).toBe('已完成');
-            expect(OrderStatusLabels[OrderStatus.CANCELLED]).toBe('已取消');
-        });
-        it('应该有正确的业务含义描述', () => {
-            expect(OrderStatusDescriptions[OrderStatus.DRAFT]).toBe('订单已创建但未提交,可继续编辑');
-            expect(OrderStatusDescriptions[OrderStatus.CONFIRMED]).toBe('订单已提交并确认,等待执行');
-            expect(OrderStatusDescriptions[OrderStatus.IN_PROGRESS]).toBe('订单正在执行中,相关人员正在处理');
-            expect(OrderStatusDescriptions[OrderStatus.COMPLETED]).toBe('订单已成功完成,所有工作已结束');
-            expect(OrderStatusDescriptions[OrderStatus.CANCELLED]).toBe('订单已被取消,不再执行');
-        });
-    });
-    describe('工作状态枚举 (WorkStatus)', () => {
-        it('应该包含4个有效的工作状态值', () => {
-            expect(WORK_STATUSES).toHaveLength(4);
-            expect(WORK_STATUSES).toEqual([
-                WorkStatus.NOT_WORKING,
-                WorkStatus.PRE_WORKING,
-                WorkStatus.WORKING,
-                WorkStatus.RESIGNED
-            ]);
-        });
-        it('应该与数据库原始值一致(小写字符串,下划线分隔)', () => {
-            expect(WorkStatus.NOT_WORKING).toBe('not_working');
-            expect(WorkStatus.PRE_WORKING).toBe('pre_working');
-            expect(WorkStatus.WORKING).toBe('working');
-            expect(WorkStatus.RESIGNED).toBe('resigned');
-        });
-        it('应该有正确的中文标签映射', () => {
-            expect(WorkStatusLabels[WorkStatus.NOT_WORKING]).toBe('未就业');
-            expect(WorkStatusLabels[WorkStatus.PRE_WORKING]).toBe('待就业');
-            expect(WorkStatusLabels[WorkStatus.WORKING]).toBe('已就业');
-            expect(WorkStatusLabels[WorkStatus.RESIGNED]).toBe('已离职');
-        });
-        it('应该有正确的业务含义描述', () => {
-            expect(WorkStatusDescriptions[WorkStatus.NOT_WORKING]).toBe('尚未开始工作,正在寻找就业机会');
-            expect(WorkStatusDescriptions[WorkStatus.PRE_WORKING]).toBe('已安排工作但尚未入职,等待入职手续');
-            expect(WorkStatusDescriptions[WorkStatus.WORKING]).toBe('正在工作中,处于在职状态');
-            expect(WorkStatusDescriptions[WorkStatus.RESIGNED]).toBe('工作已结束,已离职');
-        });
-    });
-});
-//# sourceMappingURL=enums.test.js.map

ファイルの差分が大きいため隠しています
+ 0 - 0
allin-packages/enums/tests/unit/enums.test.js.map


+ 0 - 2
allin-packages/enums/tests/unit/export.test.d.ts

@@ -1,2 +0,0 @@
-export {};
-//# sourceMappingURL=export.test.d.ts.map

+ 0 - 1
allin-packages/enums/tests/unit/export.test.d.ts.map

@@ -1 +0,0 @@
-{"version":3,"file":"export.test.d.ts","sourceRoot":"","sources":["export.test.ts"],"names":[],"mappings":""}

+ 0 - 83
allin-packages/enums/tests/unit/export.test.js

@@ -1,83 +0,0 @@
-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);
-        });
-    });
-});
-//# sourceMappingURL=export.test.js.map

ファイルの差分が大きいため隠しています
+ 0 - 0
allin-packages/enums/tests/unit/export.test.js.map


+ 2 - 1
package.json

@@ -8,7 +8,8 @@
     "dev:web": "cd web && PORT=8080 node server",
     "dev:mini": "cd mini && pnpm run dev:h5",
     "dev:weapp": "cd mini && pnpm run dev:weapp",
-    "dev:mini-ui-packages": "concurrently \"pnpm run dev:mini-enterprise-auth-ui\" \"pnpm run dev:mini-shared-ui-components\" \"pnpm run dev:yongren-shared-ui\" \"pnpm run dev:yongren-dashboard-ui\" \"pnpm run dev:yongren-order-management-ui\" \"pnpm run dev:yongren-settings-ui\" \"pnpm run dev:yongren-statistics-ui\" \"pnpm run dev:yongren-talent-management-ui\" ",
+    "dev:mini-ui-packages": "concurrently \"pnpm run dev:dev:allin-enums\" \"pnpm run dev:mini-enterprise-auth-ui\" \"pnpm run dev:mini-shared-ui-components\" \"pnpm run dev:yongren-shared-ui\" \"pnpm run dev:yongren-dashboard-ui\" \"pnpm run dev:yongren-order-management-ui\" \"pnpm run dev:yongren-settings-ui\" \"pnpm run dev:yongren-statistics-ui\" \"pnpm run dev:yongren-talent-management-ui\" ",
+    "dev:allin-enums": "pnpm --filter \"@d8d/allin-enums\" run dev",
     "dev:mini-enterprise-auth-ui": "pnpm --filter \"@d8d/mini-enterprise-auth-ui\" run dev",
     "dev:mini-shared-ui-components": "pnpm --filter \"@d8d/mini-shared-ui-components\" run dev",
     "dev:yongren-shared-ui": "pnpm --filter \"@d8d/yongren-shared-ui\" run dev",

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません