收口公开编号搜索结果弹层
平台入口公开编号搜索结果弹层改用 UnifiedModal 承接公共模态外壳 未命中提示与命中用户卡分别复用 PlatformStatusMessage 和 PlatformSubpanel 补充公开编号搜索结果弹层交互测试与收口文档记录
This commit is contained in:
@@ -7334,11 +7334,53 @@ test('public code search blocks edutainment work when entry switch is disabled',
|
||||
await user.type(searchInput, 'PZ-TMENT1');
|
||||
await user.click(screen.getByRole('button', { name: '搜索' }));
|
||||
|
||||
expect(await screen.findByText('未找到结果')).toBeTruthy();
|
||||
const dialog = await screen.findByRole('dialog', { name: '未找到结果' });
|
||||
expect(within(dialog).getByText('公开编号搜索')).toBeTruthy();
|
||||
expect(within(dialog).getByText('未找到拼图作品。')).toBeTruthy();
|
||||
await user.click(
|
||||
within(dialog).getByRole('button', { name: '关闭搜索结果' }),
|
||||
);
|
||||
|
||||
await waitFor(() => {
|
||||
expect(screen.queryByRole('dialog', { name: '未找到结果' })).toBeNull();
|
||||
});
|
||||
expect(screen.queryByText('儿童动作热身 Demo')).toBeNull();
|
||||
expect(getPuzzleGalleryDetail).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test('public code search shows public user summary in shared search result modal and clears it on close', async () => {
|
||||
const user = userEvent.setup();
|
||||
vi.mocked(authServiceMocks.getPublicAuthUserByCode).mockResolvedValue({
|
||||
id: 'public-user-yjsh',
|
||||
publicUserCode: 'SY-00000001',
|
||||
username: 'author_user',
|
||||
displayName: '公开作者',
|
||||
avatarUrl: null,
|
||||
});
|
||||
|
||||
render(<TestWrapper withAuth />);
|
||||
await openDiscoverHub(user);
|
||||
|
||||
const searchInput =
|
||||
await screen.findByPlaceholderText('搜索作品号、名称、作者、描述');
|
||||
await user.type(searchInput, '月井守望');
|
||||
await user.click(screen.getByRole('button', { name: '搜索' }));
|
||||
|
||||
const dialog = await screen.findByRole('dialog', { name: '命中用户' });
|
||||
expect(within(dialog).getByText('公开编号搜索')).toBeTruthy();
|
||||
expect(within(dialog).getByText('公开作者')).toBeTruthy();
|
||||
expect(within(dialog).getByText('陶泥号')).toBeTruthy();
|
||||
expect(within(dialog).getByText('SY-00000001')).toBeTruthy();
|
||||
|
||||
await user.click(
|
||||
within(dialog).getByRole('button', { name: '关闭搜索结果' }),
|
||||
);
|
||||
|
||||
await waitFor(() => {
|
||||
expect(screen.queryByRole('dialog', { name: '命中用户' })).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
test('creation hub clears all private work shelves immediately after logout state', async () => {
|
||||
const user = userEvent.setup();
|
||||
const loggedInAuth = createAuthValue();
|
||||
|
||||
Reference in New Issue
Block a user