import { describe, expect, it } from 'vitest'; import { readFileSync } from 'fs'; import path from 'path'; describe('分类固定采购员源码守栏', () => { it('建自采先查分类绑定,加单 lockPurchaser', () => { const src = readFileSync( path.join(__dirname, '../src/services/orderAllocationService.ts'), 'utf8' ); expect(src).toContain('resolveMappedPurchaserForCategory'); expect(src).toContain('lockPurchaser'); expect(src).toContain('if (params.lockPurchaser && params.purchaser)'); expect(src).toContain('purchaser: primaryPurchaser'); }); it('默认分配四种 mode 未并入分类绑定', () => { const src = readFileSync( path.join(__dirname, '../src/services/purchaseAssignDefaultConfigService.ts'), 'utf8' ); expect(src).not.toContain('to_category_purchaser'); expect(src).not.toContain('category_map'); }); });