文件
shanghaipeiwan/server/tests/admin-demo-data-cleanup.spec.ts
xcbyy f1f8952e97 chore(admin): 清理后台静态演示数据(我的团队/最新动态/通知中心返回空)
- /api/user/my-team/list 不再返回硬编码团队成员,改为空数组

- /api/user/latest-activity 不再返回硬编码动态,改为空数组

- /api/message/list 不再返回硬编码站内消息,改为空数组

- 新增回归护栏 admin-demo-data-cleanup.spec.ts(81 套件/617 用例全绿)
2026-10-19 09:08:21 +08:00

34 行
1.3 KiB
TypeScript

// 已读取AGENTS.md
import * as fs from 'fs';
import * as path from 'path';
/**
* 第六十五批回归闸门:清理后台静态演示数据
*/
describe('第六十五批后台演示数据清理闸门', () => {
const rootDir = path.resolve(__dirname, '../../');
const indexCode = fs.readFileSync(path.join(rootDir, 'server/src/index.ts'), 'utf-8');
it('不再返回硬编码团队/动态/通知演示数据', () => {
expect(indexCode).not.toContain('同城活动运营组');
expect(indexCode).not.toContain('财务与结算中心');
expect(indexCode).not.toContain('完成了苏苏学姐的微信商户打款审核');
expect(indexCode).not.toContain('处理了工体纯KTV争议仲裁单');
expect(indexCode).not.toContain('可可奶芙、夜风沉醉');
expect(indexCode).not.toContain('MySQL 数据库就绪');
});
it('相关接口返回空数组(由前端展示空态)', () => {
for (const marker of [
"app.all('/api/user/my-team/list'",
"app.all('/api/user/latest-activity'",
"app.all('/api/message/list'",
]) {
const start = indexCode.indexOf(marker);
expect(start).toBeGreaterThan(-1);
const block = indexCode.slice(start, start + 220);
expect(block).toContain('data: []');
}
});
});