fix(community): add missing heart and heartFilled icons to restore like button rendering

这个提交包含在:
xcbyy
2026-10-13 15:37:07 +08:00
父节点 fb23b262b3
当前提交 3d895a1a0a
共有 3 个文件被更改,包括 41 次插入 和 1 次删除

查看文件

@@ -917,6 +917,34 @@ describe('ContentSecurityService & Compliance Architecture (TDD 微信内容安
expect(emojiRegex.test(content)).toBe(false);
});
});
describe('21. 友圈广场点赞图标与矢量图标库完整性验证 (pwuniapp/common/icons.js & pages/community/index.vue)', () => {
const iconsPath = path.join(rootDir, 'pwuniapp', 'common', 'icons.js');
const communityPath = path.join(rootDir, 'pwuniapp', 'pages', 'community', 'index.vue');
it('icons.js 必须完整导出 heart (未点赞) 与 heartFilled (已点赞高亮) 矢量图标', () => {
expect(fs.existsSync(iconsPath)).toBe(true);
const content = fs.readFileSync(iconsPath, 'utf-8');
expect(content).toContain('heart: svgToUri');
expect(content).toContain('heartFilled: svgToUri');
expect(content).toContain('#94A3B8');
expect(content).toContain('#EF4444');
});
it('友圈广场页面点赞按钮必须正确绑定 heartFilled 与 heart 图标', () => {
expect(fs.existsSync(communityPath)).toBe(true);
const content = fs.readFileSync(communityPath, 'utf-8');
expect(content).toContain(':src="post.liked ? ICONS.heartFilled : ICONS.heart"');
});
it('icons.js 与友圈广场页面严禁包含任何系统 Emoji 违规字符', () => {
const iconsContent = fs.readFileSync(iconsPath, 'utf-8');
const communityContent = fs.readFileSync(communityPath, 'utf-8');
const emojiRegex = /(?:\p{Extended_Pictographic}|\p{Emoji_Presentation}|[\u2600-\u27BF])/u;
expect(emojiRegex.test(iconsContent)).toBe(false);
expect(emojiRegex.test(communityContent)).toBe(false);
});
});
});