fix(mobile): focus SOP answers after search

This commit is contained in:
2026-07-17 04:25:26 +08:00
parent e93421ca1e
commit 0745d51e57
3 changed files with 39 additions and 6 deletions
+6 -4
View File
@@ -37,14 +37,16 @@ test('训练页提交失败会回滚本次乐观追加的对话', async () => {
assert.match(source, /turns\.value = previousTurns/);
});
test('训练结果和 SOP 答案生成后重置到内容首屏', async () => {
const [practiceSource, sopSource] = await Promise.all([
test('训练结果回到顶部,SOP 答案生成后定位到回答区', async () => {
const [practiceSource, sopSource, navigationSource] = await Promise.all([
pageSource('../src/pages/user/practice/index.vue'),
pageSource('../src/pages/user/sop/index.vue')
pageSource('../src/pages/user/sop/index.vue'),
pageSource('../src/services/navigation.ts')
]);
assert.match(practiceSource, /result\.value = await finishPractice\([\s\S]*?resetPageScroll\(\)/);
assert.match(sopSource, /result\.value = await searchKnowledge\(value\);\s*resetPageScroll\(\)/);
assert.match(sopSource, /result\.value = await searchKnowledge\(value\);\s*scrollPageToSelector\('\.answer-panel'/);
assert.match(navigationSource, /export const scrollPageToSelector = \(selector: string/);
});
test('训练历史按摘要、逐句复盘、SOP 依据和行动建议分层', async () => {