import { describe, it } from 'node:test' import assert from 'node:assert/strict' import { PRODUCTION_WORK_ORDER_VISIBLE_TABS, parseProductionWorkOrderTabKey, workOrderMatchesTab, isPilotServiceOutboundWorkOrder } from './production-work-order-tabs' import { PRODUCTION_WORK_ORDER_CATEGORY_OPTIONS } from './production-work-order-category' describe('production work order tabs — hide pilot service', () => { it('visible tabs exclude outbound_pilot_service', () => { assert.ok(!PRODUCTION_WORK_ORDER_VISIBLE_TABS.some((t) => t.key === 'outbound_pilot_service')) assert.ok(!PRODUCTION_WORK_ORDER_CATEGORY_OPTIONS.some((o) => o.key === 'outbound_pilot_service')) }) it('parse: hidden pilot key and outbound alias fall back safely', () => { assert.equal(parseProductionWorkOrderTabKey('outbound_pilot_service'), 'all') assert.equal(parseProductionWorkOrderTabKey('outbound'), 'outbound_basic_experiment') }) it('「所有」excludes pilot outbound (incl. default bizType)', () => { const pilot = { workOrderType: 'outbound', bizType: 'pilot_service' } const defaultPilot = { workOrderType: 'outbound' } const basic = { workOrderType: 'outbound', bizType: 'basic_experiment' } assert.equal(isPilotServiceOutboundWorkOrder(pilot), true) assert.equal(isPilotServiceOutboundWorkOrder(defaultPilot), true) assert.equal(workOrderMatchesTab(pilot as any, 'all'), false) assert.equal(workOrderMatchesTab(defaultPilot as any, 'all'), false) assert.equal(workOrderMatchesTab(basic as any, 'all'), true) }) })