feat(assistant): unify confirmed memory capture
This commit is contained in:
@@ -26,15 +26,17 @@ test('个人助理客户端使用确认式记忆接口且确认请求携带稳
|
||||
assert.match(service, /\$\{candidateBase\}\/\$\{candidateId\}\/confirm/);
|
||||
assert.match(service, /\$\{candidateBase\}\/\$\{candidateId\}\/dismiss/);
|
||||
assert.match(service, /\/api\/aihr\/service-memories/);
|
||||
assert.match(service, /\/api\/aihr\/personal-assistant\/assistant-captures/);
|
||||
assert.match(card, /const idempotencyKey = ref\(createMemoryIdempotencyKey\(props\.candidate\.id\)\)/);
|
||||
assert.match(card, /if \(submitting\.value \|\| completed\.value\) return/);
|
||||
assert.match(card, /expectedVersion: props\.candidate\.version/);
|
||||
assert.match(card, /enableReminder: reminderEnabled\.value/);
|
||||
assert.match(card, /saveScope: saveScope \|\| undefined/);
|
||||
assert.match(card, /\.\.\.value/);
|
||||
for (const field of ['projectCode', 'title', 'detail', 'status']) assert.match(card, new RegExp(field));
|
||||
});
|
||||
|
||||
test('候选确认卡区分待补充和草稿,提醒默认关闭并保留三个动作', async () => {
|
||||
test('统一采集确认卡把缺失字段作为可选提示并让用户选择保存范围', async () => {
|
||||
const card = await read('../src/components/chat/MemoryCandidateCard.vue');
|
||||
|
||||
assert.match(card, /candidate\.status === 'NEEDS_INPUT'/);
|
||||
@@ -43,6 +45,10 @@ test('候选确认卡区分待补充和草稿,提醒默认关闭并保留三
|
||||
assert.match(card, />修改</);
|
||||
assert.match(card, />暂不保存</);
|
||||
assert.match(card, />确认保存</);
|
||||
assert.match(card, />仅自己保存</);
|
||||
assert.match(card, />提交公司处理</);
|
||||
assert.match(card, /可继续补充:/);
|
||||
assert.doesNotMatch(card, />还需要补充信息</);
|
||||
assert.match(card, /v-if="reminderEnabled"/);
|
||||
for (const field of ['buildingName', 'unitName', 'roomNo']) {
|
||||
assert.match(card, new RegExp(`value: draft\\.value\\.${field}`));
|
||||
@@ -65,15 +71,31 @@ test('工作助手页面展示任务过期后不会消费待执行查询或数
|
||||
assert.match(page, /ensureEmployeePosition\('\/pages\/user\/sop\/index'\)\) \|\| !isCurrentQuestion\(\)/);
|
||||
});
|
||||
|
||||
test('我的资料与记忆展示个人记录和公司流转状态', async () => {
|
||||
const [page, service] = await Promise.all([
|
||||
read('../src/pages/user/assistant/memories.vue'),
|
||||
read('../src/services/personal-assistant.ts')
|
||||
]);
|
||||
|
||||
assert.match(page, /getAssistantCaptures/);
|
||||
assert.match(page, />我的记录</);
|
||||
assert.match(page, /仅自己保存的内容不会提交公司/);
|
||||
assert.match(page, /deliveryLabel\(item\.deliveryStatus\)/);
|
||||
assert.match(service, /assistant-captures\?limit=50/);
|
||||
});
|
||||
|
||||
test('工作助手保留原问答链并只提供显式查全网入口', async () => {
|
||||
const [page, knowledge] = await Promise.all([
|
||||
const [page, header, knowledge] = await Promise.all([
|
||||
read('../src/pages/user/sop/index.vue'),
|
||||
read('../src/components/chat/AskSourceHeader.vue'),
|
||||
read('../src/services/knowledge.ts')
|
||||
]);
|
||||
|
||||
assert.match(page, />工作助手<\/button>/);
|
||||
assert.match(page, />查全网<\/button>/);
|
||||
assert.match(header, />\s*工作助手\s*<\/button>/);
|
||||
assert.match(header, />\s*查全网\s*<\/button>/);
|
||||
assert.match(page, /@select-web="openWebAi"/);
|
||||
assert.match(page, /<MemoryCandidateCard/);
|
||||
assert.match(page, /msg\.result\.answer \|\| msg\.result\.snippets\?\.length \|\| !msg\.result\.memoryCandidate/);
|
||||
assert.match(page, /msg\.result\.noEvidence/);
|
||||
assert.match(page, /@click="openWebAi">去查全网/);
|
||||
assert.match(knowledge, /url: '\/api\/knowledge\/query'/);
|
||||
@@ -137,7 +159,7 @@ test('我的页面和路由提供首版资料与记忆入口', async () => {
|
||||
assert.match(profile, /openMemories/);
|
||||
assert.match(memories, /待确认/);
|
||||
assert.match(memories, /项目跟进/);
|
||||
assert.match(memories, /首版仅展示/);
|
||||
assert.match(memories, /仅展示当前账号有权限查看的项目服务记录/);
|
||||
assert.match(memories, /项目:\{\{ item\.projectCode \}\}/);
|
||||
assert.match(pages, /pages\/user\/assistant\/memories/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user