import assert from 'node:assert/strict' import { describe, it } from 'node:test' import { resolveDocumentReminderEditPath, resolveDocumentReminderFormMode, DOCUMENT_REMINDER_JUMP_UNSUPPORTED } from './pl-document-reminder-jump' describe('证件提醒表单模式与路径', () => { it('车辆按 vehicleType 解析弹窗类型与路径', () => { assert.deepEqual( resolveDocumentReminderFormMode({ ownerType: 'vehicle', vehicleType: 'self' }), { kind: 'vehicle', vehicleType: 'self' } ) assert.deepEqual( resolveDocumentReminderFormMode({ ownerType: 'vehicle', vehicleType: 'carrier' }), { kind: 'vehicle', vehicleType: 'carrier' } ) assert.deepEqual(resolveDocumentReminderFormMode({ ownerType: 'vehicle', vehicleType: '' }), { kind: 'vehicle', vehicleType: 'carrier' }) assert.equal( resolveDocumentReminderEditPath({ ownerType: 'vehicle', vehicleType: 'self' }), '/vehicle-mgmt/base-info/self-vehicle' ) assert.equal( resolveDocumentReminderEditPath({ ownerType: 'vehicle', vehicleType: 'carrier' }), '/vehicle-mgmt/base-info/vehicle' ) }) it('人员按 personnelAffiliation 解析弹窗归属与路径', () => { assert.deepEqual( resolveDocumentReminderFormMode({ ownerType: 'personnel', personnelAffiliation: 'self' }), { kind: 'personnel', affiliation: 'self' } ) assert.deepEqual( resolveDocumentReminderFormMode({ ownerType: 'personnel', personnelAffiliation: 'carrier' }), { kind: 'personnel', affiliation: 'carrier' } ) assert.deepEqual( resolveDocumentReminderFormMode({ ownerType: 'personnel', personnelAffiliation: '' }), { kind: 'personnel', affiliation: 'self' } ) assert.equal( resolveDocumentReminderEditPath({ ownerType: 'personnel', personnelAffiliation: 'carrier' }), '/vehicle-mgmt/base-info/personnel-carrier' ) }) it('不支持的主体返回 null', () => { assert.equal(resolveDocumentReminderFormMode({ ownerType: 'carrier' }), null) assert.equal(resolveDocumentReminderEditPath({ ownerType: '' }), null) assert.equal(DOCUMENT_REMINDER_JUMP_UNSUPPORTED, '暂不支持该主体类型的证件维护跳转') }) })