fix: hide public card account identifiers
This commit is contained in:
@@ -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],
|
||||
|
||||
Reference in New Issue
Block a user