fix: hide public card account identifiers

This commit is contained in:
2026-06-03 12:09:03 +08:00
parent 3f742fbaca
commit 545ffa4b2c
7 changed files with 96 additions and 10 deletions

View File

@@ -3434,6 +3434,34 @@ test('public gallery cards hide work code until detail is opened', async () => {
expect(onOpenGalleryDetail).toHaveBeenCalledWith(puzzlePublicEntry);
});
test('public gallery cards hide phone masked author and public user code', async () => {
mockDesktopLayout();
const user = userEvent.setup();
const maskedAuthorEntry = {
...puzzlePublicEntry,
workId: 'puzzle-work-masked-author',
profileId: 'puzzle-profile-masked-author',
publicWorkCode: 'PZ-MASKED1',
authorDisplayName: '158****3533 · SY-00000003',
worldName: '喜气洋洋',
} satisfies PlatformPublicGalleryCard;
renderStatefulLoggedOutHomeView(
{
latestEntries: [maskedAuthorEntry],
},
true,
);
await user.click(screen.getByRole('button', { name: '发现' }));
const card = screen.getByRole('button', { name: //u });
expect(card).toBeTruthy();
expect(within(card).getByText('公开作者')).toBeTruthy();
expect(within(card).queryByText('158****3533 · SY-00000003')).toBeNull();
expect(within(card).queryByText('158****3533')).toBeNull();
expect(within(card).queryByText('SY-00000003')).toBeNull();
});
test('logged out mobile shell defaults to discover tab', () => {
const { container } = renderStatefulLoggedOutHomeView({
latestEntries: [puzzlePublicEntry],