21 行
864 B
TypeScript
21 行
864 B
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('公开目录仅返回已通过大神且剥离 rejectReason,管理端保留全量', () => {
|
|
const start = indexCode.indexOf("app.get('/api/companions',");
|
|
expect(start).toBeGreaterThan(-1);
|
|
const block = indexCode.slice(start, start + 900);
|
|
expect(block).toContain('isVerifiedAdminRequest(req)');
|
|
expect(block).toContain("c.auditStatus === '已通过'");
|
|
expect(block).toContain('const { rejectReason, userId, idCardMasked, ...rest } = c;');
|
|
});
|
|
});
|