feat(practice): streamline pilot content operations

This commit is contained in:
2026-07-25 12:51:39 +08:00
parent 35b37b07f7
commit fa9d6da975
9 changed files with 380 additions and 24 deletions
+6 -2
View File
@@ -376,10 +376,14 @@ test('场景目录加载失败时清空旧场景并禁止开始训练', async ()
assert.match(source, /!curriculumLoading\.value/);
});
test('无已发布场景时不展示默认预习卡或训练入口', async () => {
test('无已发布场景时隐藏常规训练,但仍展示独立实时陪练入口', async () => {
const source = await pageSource('../src/pages/user/practice/index.vue');
assert.match(source, /v-if="loggedIn && practiceView === 'prep' && availableScenarios\.length" class="panel scenario-card employee-card"/);
assert.match(source, /v-if="loggedIn && practiceView === 'prep' && availableScenarios\.length" class="panel scenario-card practice-scenario-card employee-card"/);
assert.match(source, /v-if="loggedIn && practiceView === 'prep'" class="panel scenario-card realtime-entry-card employee-card"/);
assert.match(source, /:disabled="!canStartRealtime \|\| busy"/);
assert.match(source, /if \(!canStartRealtime\.value \|\| !requireLogin\(\)\) return;/);
assert.doesNotMatch(source, /if \(!canStartPractice\.value \|\| !requireLogin\(\)\) return;\s*speechPlayback\.stop\(\);\s*cancelRecording\(\);\s*turnVoiceGeneration \+= 1;/);
assert.match(source, /const activeScenario = nextScenarios\.find\([\s\S]*?\|\| nextScenarios\[0\];[\s\S]*?else \{\s*selectedScenarioId\.value = '';\s*activeScenarioName\.value = '暂无可用训练场景';\s*prepCard\.value = null;/);
});