feat(assistant): unify confirmed memory capture

This commit is contained in:
2026-07-20 02:30:06 +08:00
parent 46a6156d8c
commit 0a5fc9a463
32 changed files with 949 additions and 242 deletions
+22 -1
View File
@@ -88,6 +88,27 @@ test('员工端首页、问师傅和训练页接入当前共享基座', async ()
assert.match(practiceSource, /scenario-card employee-card/);
});
test('工作助手与查全网使用一致的来源切换头部', async () => {
const [sopSource, webAiSource, headerSource] = await Promise.all([
pageSource('../src/pages/user/sop/index.vue'),
pageSource('../src/pages/user/web-ai/index.vue'),
pageSource('../src/components/chat/AskSourceHeader.vue')
]);
for (const page of [sopSource, webAiSource]) {
assert.match(page, /import AskSourceHeader from ['"]@\/components\/chat\/AskSourceHeader\.vue['"]/);
assert.match(page, /<AskSourceHeader\b/);
assert.doesNotMatch(page, /(?:^|\n)\s*\.chat-source-switch(?:\s+\.source-option(?:\.active)?)?\s*\{/);
}
assert.match(headerSource, /<text class="head-title">问 · 数字师傅<\/text>/);
assert.match(headerSource, /\.source-option\s*\{[^}]*height:\s*44px/);
assert.match(headerSource, /\.new-chat-button\s*\{[^}]*min-height:\s*44px/);
assert.match(headerSource, /@click="emit\('newConversation'\)"/);
assert.doesNotMatch(sopSource, /(?:^|\n)\s*\.source-switch\s*\{/);
assert.doesNotMatch(sopSource, /(?:^|\n)\s*\.source-option(?:\.active)?\s*\{/);
});
test('登录后按组织身份切换主管首页', async () => {
const source = await pageSource('../src/services/position.ts');
@@ -198,7 +219,7 @@ test('员工问师傅页显示当前岗位而不是固定生活顾问', async ()
assert.match(source, /getSelectedPosition/);
assert.match(source, /const positionLabel = ref\(getSelectedPosition\(\)\)/);
assert.match(source, /\{\{ positionLabel \}\} · 住宅项目/);
assert.match(source, /:context="`\$\{positionLabel\} · 住宅项目`"/);
assert.doesNotMatch(source, /sop-context">管家(生活顾问) · 住宅项目/);
});