import { describe, expect, it } from 'vitest'; import { resolveNotificationTarget } from './notificationNavigation'; describe('resolveNotificationTarget zero_sale_price', () => { it('opens order detail for related order', () => { expect( resolveNotificationTarget({ title: '销售价为 0:ORD1', content: '订单 ORD1 有 1 条明细销售价为 0', notify_type: 'zero_sale_price', related_order_code: 'ORD1', }) ).toEqual({ path: '/orders', search: { q: 'ORD1', open: '1' } }); }); it('opens the orders list when no order code', () => { expect( resolveNotificationTarget({ title: '销售价为 0', content: null, notify_type: 'zero_sale_price', related_order_code: null, }) ).toEqual({ path: '/orders', search: undefined }); }); });