// 已读取AGENTS.md import * as fs from 'fs'; import * as path from 'path'; /** * 第五十九批回归闸门:帮助中心 FAQ 改为独立页面(非弹窗) */ describe('第五十九批帮助中心页面化闸门', () => { const rootDir = path.resolve(__dirname, '../../'); const faqPagePath = path.join(rootDir, 'pwuniapp/pages/user/help-faq.vue'); const pagesJson = fs.readFileSync(path.join(rootDir, 'pwuniapp/pages.json'), 'utf-8'); const userIndex = fs.readFileSync(path.join(rootDir, 'pwuniapp/pages/user/index.vue'), 'utf-8'); it('新增独立 FAQ 页面并注册路由', () => { expect(fs.existsSync(faqPagePath)).toBe(true); const page = fs.readFileSync(faqPagePath, 'utf-8'); expect(page).toContain('getPlatformConfigs'); expect(page).toContain('faq_list'); expect(page).toContain('activeIndex'); expect(pagesJson).toContain('"path": "pages/user/help-faq"'); }); it('个人中心点击进入新页面而非弹窗', () => { const start = userIndex.indexOf('const openFaq'); expect(start).toBeGreaterThan(-1); const end = userIndex.indexOf('};', start); const block = userIndex.slice(start, end + 2); expect(block).toContain("url: '/pages/user/help-faq'"); expect(block).not.toContain('showActionSheet'); expect(block).not.toContain('showModal'); }); });