fix(aihr): close Figma UI regression gaps

This commit is contained in:
2026-07-17 04:17:14 +08:00
parent a822b22116
commit e93421ca1e
35 changed files with 1452 additions and 107 deletions
@@ -37,6 +37,33 @@ test('训练页提交失败会回滚本次乐观追加的对话', async () => {
assert.match(source, /turns\.value = previousTurns/);
});
test('训练结果和 SOP 答案生成后重置到内容首屏', async () => {
const [practiceSource, sopSource] = await Promise.all([
pageSource('../src/pages/user/practice/index.vue'),
pageSource('../src/pages/user/sop/index.vue')
]);
assert.match(practiceSource, /result\.value = await finishPractice\([\s\S]*?resetPageScroll\(\)/);
assert.match(sopSource, /result\.value = await searchKnowledge\(value\);\s*resetPageScroll\(\)/);
});
test('训练历史按摘要、逐句复盘、SOP 依据和行动建议分层', async () => {
const source = await pageSource('../src/pages/user/history/index.vue');
assert.match(source, /训练摘要/);
assert.match(source, /录音与逐句复盘/);
assert.match(source, /SOP 依据与改进建议/);
assert.match(source, /推荐话术/);
});
test('案例页为无权限和无案例提供明确空状态', async () => {
const source = await pageSource('../src/pages/user/cases/index.vue');
assert.match(source, /class="case-empty-state"/);
assert.match(source, /暂时还没有可学习案例/);
assert.match(source, /提交权限由组织角色决定/);
});
test('manifest 明确声明为 uni-app Vue3 CLI 工程', async () => {
const source = await pageSource('../src/manifest.json');
@@ -66,6 +93,8 @@ test('登录页按高保真原型保留品牌结构和紧凑验证码行', async
test('共享视觉基座包含员工端主色和卡片圆角 token', async () => {
const source = await pageSource('../src/styles/base.css');
assert.match(source, /lxgw-wenkai-tc-webfont/);
assert.match(source, /font-family:\s*"LXGW WenKai TC"/);
assert.match(source, /--employee-primary:\s*#e60012/);
assert.match(source, /--employee-card-radius:\s*24px/);
assert.match(source, /\.employee-card\s*\{/);
@@ -143,6 +172,21 @@ test('问师傅页保留搜索框、答案区和总结卡入口', async () => {
assert.match(source, /summary-panel/);
});
test('SOP 没解决先收集结构化原因再提交', async () => {
const [source, service] = await Promise.all([
pageSource('../src/pages/user/sop/index.vue'),
pageSource('../src/services/knowledge.ts')
]);
assert.match(source, /feedbackReasonOptions/);
assert.match(source, /negative-feedback-panel/);
assert.match(source, /submitNegativeFeedback/);
assert.match(source, /reasonCodes:\s*selectedFeedbackReasons\.value/);
assert.match(source, /comment:\s*feedbackComment\.value\.trim\(\)/);
assert.match(service, /reasonCodes\?:\s*string\[\]/);
assert.match(service, /comment\?:\s*string/);
});
test('训练页保留任务卡、对话区、回复区和结果区并互斥切换', async () => {
const source = await pageSource('../src/pages/user/practice/index.vue');
@@ -156,6 +200,23 @@ test('训练页保留任务卡、对话区、回复区和结果区并互斥切
assert.match(source, /practiceView === 'prep'/);
assert.match(source, /practiceView === 'active'/);
assert.match(source, /practiceView\.value === 'result'/);
assert.match(source, /result\.score\?\.length/);
assert.match(source, /class="result-dimensions"/);
});
test('底部固定导航页面复用安全操作区', async () => {
const [base, practice, assign, review] = await Promise.all([
pageSource('../src/styles/base.css'),
pageSource('../src/pages/user/practice/index.vue'),
pageSource('../src/pages/supervisor/assign/index.vue'),
pageSource('../src/pages/supervisor/review/index.vue')
]);
assert.match(base, /--app-bottom-nav-space/);
assert.match(base, /\.tabbar-safe-action\s*\{/);
assert.match(practice, /primary-button tabbar-safe-action/);
assert.match(assign, /primary-button submit-button tabbar-safe-action/);
assert.match(review, /primary-button submit-button tabbar-safe-action/);
});
test('员工练习页显示当前岗位而不是固定生活顾问', async () => {