Files
syops/frontend/src/features/chat/shipping/shippingWorkbenchLayout.spec.ts
T
hugo e472abc4e3 feat(shipping-notice): 货代会话主区域切换为批次中心常驻并按附件派生会话标题
- 会话命名:新增业务命名纯函数,新建抽取会话按附件内容派生标题,仅新建不回填不改名
- 批次中心常驻主区域并展示会话标题:移除关闭入口、隐藏对话列、去除面板外壳与折叠/钉住徽标
- 清理对话流打开批次中心的冗余链路
- 新增设计文档与实施计划,同步功能清单说明
2026-09-17 15:54:47 +08:00

25 lines
1.2 KiB
TypeScript

/**
* features/chat/shipping/shippingWorkbenchLayout.spec.ts
* 用途:锁定货代会话主区域显隐规则(有会话即全屏批次进度中心,方案 A)。
* 依赖:Vitest、纯函数。
* 逻辑:判定必须同时满足货代智能体与非空会话 ID;普通智能体与新会话一律回落欢迎页。
*/
import { describe, expect, it } from 'vitest';
import { shouldShowShippingWorkbench } from './shippingWorkbenchLayout';
describe('shouldShowShippingWorkbench', () => {
it('renders the workbench for the shipping agent once a conversation exists', () => {
expect(shouldShowShippingWorkbench({ isShippingNoticeAgent: true, conversationId: 'conv-1' })).toBe(true);
});
it('keeps the welcome composer before a conversation is created', () => {
expect(shouldShowShippingWorkbench({ isShippingNoticeAgent: true, conversationId: '' })).toBe(false);
expect(shouldShowShippingWorkbench({ isShippingNoticeAgent: true, conversationId: null })).toBe(false);
});
it('never switches other agents to the workbench', () => {
expect(shouldShowShippingWorkbench({ isShippingNoticeAgent: false, conversationId: 'conv-1' })).toBe(false);
});
});