fix: hide public card account identifiers
This commit is contained in:
@@ -224,7 +224,7 @@ test('resolves public work author from display name and public user code before
|
||||
displayName: '公开昵称',
|
||||
avatarUrl: null,
|
||||
}),
|
||||
).toBe('公开昵称 · SY-00000004');
|
||||
).toBe('公开昵称');
|
||||
expect(
|
||||
resolvePlatformWorkAuthorDisplayName(card, {
|
||||
id: 'user_00000004',
|
||||
@@ -237,6 +237,36 @@ test('resolves public work author from display name and public user code before
|
||||
expect(resolvePlatformWorkAuthorDisplayName(card, null)).toBe('敲木鱼玩家');
|
||||
});
|
||||
|
||||
test('public work author display hides phone masks and public user codes on cards', () => {
|
||||
const card = mapWoodenFishWorkToPlatformGalleryCard({
|
||||
publicWorkCode: 'WF-AUTHOR2',
|
||||
workId: 'wooden-fish-work-author-mask',
|
||||
profileId: 'wooden-fish-profile-author-mask',
|
||||
ownerUserId: 'user-author-mask',
|
||||
authorDisplayName: '158****3533 · SY-00000003',
|
||||
workTitle: '喜气洋洋',
|
||||
workDescription: '喜庆主题敲木鱼。',
|
||||
coverImageSrc: null,
|
||||
themeTags: ['敲木鱼'],
|
||||
publicationStatus: 'published',
|
||||
playCount: 0,
|
||||
updatedAt: '2026-05-20T00:00:00.000Z',
|
||||
publishedAt: '2026-05-20T00:00:00.000Z',
|
||||
generationStatus: 'ready',
|
||||
});
|
||||
|
||||
expect(
|
||||
resolvePlatformWorkAuthorDisplayName(card, {
|
||||
id: 'user_00000003',
|
||||
publicUserCode: 'SY-00000003',
|
||||
username: '158****3533',
|
||||
displayName: '158****3533',
|
||||
avatarUrl: null,
|
||||
}),
|
||||
).toBe('玩家');
|
||||
expect(resolvePlatformWorkAuthorDisplayName(card, null)).toBe('玩家');
|
||||
});
|
||||
|
||||
test('keeps baby object match public card code and template label intact', () => {
|
||||
const card: PlatformEdutainmentGalleryCard = {
|
||||
sourceType: 'edutainment',
|
||||
|
||||
Reference in New Issue
Block a user