fix(aihr): clear stale candidate records on fetch failure

This commit is contained in:
2026-07-14 12:44:44 +08:00
parent d31a09a846
commit e834546d23
6 changed files with 24 additions and 0 deletions
+12
View File
@@ -85,6 +85,18 @@ test('候选首页只做状态总览和独立页面分流', async () => {
assert.doesNotMatch(source, /interviewQuestions/);
});
test('候选端刷新失败不保留上一轮真实记录', async () => {
const [home, materials, progress] = await Promise.all([
pageSource('../src/pages/candidate/index/index.vue'),
pageSource('../src/pages/candidate/materials/index.vue'),
pageSource('../src/pages/candidate/progress/index.vue')
]);
assert.match(home, /catch \(error\) \{\n\s*clearData\(\);/);
assert.match(materials, /catch \(error\) \{\n\s*clearData\(\);/);
assert.match(progress, /catch \(error\) \{\n\s*clearData\(\);/);
});
test('面试、资料、进度和预习页各自只承载一类真实任务', async () => {
const [interview, materials, progress, study] = await Promise.all([
pageSource('../src/pages/candidate/interview/index.vue'),