客户已下线中试业务:侧栏不再展示中试 Tab,前端在「所有」列表过滤出库中试数据(含 bizType 缺省)。 Co-authored-by: Cursor <cursoragent@cursor.com>
34 lines
1.5 KiB
TypeScript
34 lines
1.5 KiB
TypeScript
import { describe, it } from 'node:test'
|
|
import assert from 'node:assert/strict'
|
|
import {
|
|
QC_WORK_ORDER_VISIBLE_TABS,
|
|
parseQcWorkOrderTabKey,
|
|
workOrderMatchesTab,
|
|
isPilotServiceOutboundWorkOrder
|
|
} from './qc-work-order-tabs'
|
|
import { QC_WORK_ORDER_CATEGORY_OPTIONS } from './qc-work-order-category'
|
|
|
|
describe('qc work order tabs — hide pilot service', () => {
|
|
it('visible tabs exclude outbound_pilot_service', () => {
|
|
assert.ok(!QC_WORK_ORDER_VISIBLE_TABS.some((t) => t.key === 'outbound_pilot_service'))
|
|
assert.ok(!QC_WORK_ORDER_CATEGORY_OPTIONS.some((o) => o.key === 'outbound_pilot_service'))
|
|
})
|
|
|
|
it('parse: hidden pilot key and outbound alias fall back safely', () => {
|
|
// 质检默认 Tab 为细胞存储(「所有」本身也是 hidden)
|
|
assert.equal(parseQcWorkOrderTabKey('outbound_pilot_service'), 'inbound_cell_storage')
|
|
assert.equal(parseQcWorkOrderTabKey('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)
|
|
})
|
|
})
|