收口个人中心已玩弹窗组件
迁移个人中心存档和玩过弹窗简单空态到 PlatformEmptyState 迁移玩过弹窗分区标题到 PlatformFieldLabel 迁移已玩作品按钮卡到 PlatformSubpanel 并保留粉色 hover 边框 补充已玩弹窗公共组件断言并更新 PlatformUiKit 文档和 Hermes 决策记录
This commit is contained in:
@@ -2759,6 +2759,22 @@ test('profile played modal summary and work type use platform pill badges', asyn
|
||||
const playedModal = screen
|
||||
.getByText('潮雾列岛')
|
||||
.closest('.fixed') as HTMLElement;
|
||||
const playedSectionLabel = within(playedModal)
|
||||
.getAllByText('玩过')
|
||||
.find((element) => element.className.includes('tracking-[0.18em]'));
|
||||
expect(playedSectionLabel?.className).toContain(
|
||||
'text-[var(--platform-text-soft)]',
|
||||
);
|
||||
|
||||
const playedWorkButton = within(playedModal)
|
||||
.getByText('潮雾列岛')
|
||||
.closest('button') as HTMLElement;
|
||||
expect(playedWorkButton.className).toContain(
|
||||
'border-[var(--platform-subpanel-border)]',
|
||||
);
|
||||
expect(playedWorkButton.className).toContain('hover:border-[#ff4056]');
|
||||
expect(playedWorkButton.className).toContain('focus-visible:ring-2');
|
||||
|
||||
const totalPlayTimeBadge = within(playedModal).getByText('1.5小时');
|
||||
expect(totalPlayTimeBadge.className).toContain('rounded-full');
|
||||
expect(totalPlayTimeBadge.className).toContain('border-rose-100');
|
||||
@@ -2770,6 +2786,32 @@ test('profile played modal summary and work type use platform pill badges', asyn
|
||||
expect(workTypeBadge.className).toContain('text-[#ff4056]');
|
||||
});
|
||||
|
||||
test('profile played modal empty state uses platform empty state', async () => {
|
||||
renderProfileView(
|
||||
vi.fn(),
|
||||
{
|
||||
playedWorldCount: 0,
|
||||
},
|
||||
{},
|
||||
0,
|
||||
{
|
||||
isProfilePlayStatsOpen: true,
|
||||
profilePlayStats: {
|
||||
totalPlayTimeMs: 0,
|
||||
playedWorks: [],
|
||||
updatedAt: '2026-04-19T12:00:00.000Z',
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
const emptyState = await screen.findByText('暂无玩过');
|
||||
expect(emptyState.className).toContain('platform-empty-state');
|
||||
expect(emptyState.className).toContain(
|
||||
'border-[var(--platform-subpanel-border)]',
|
||||
);
|
||||
expect(emptyState.className).toContain('text-left');
|
||||
});
|
||||
|
||||
test('profile played works card shows count unit', async () => {
|
||||
renderProfileView(vi.fn(), {
|
||||
playedWorldCount: 1,
|
||||
|
||||
Reference in New Issue
Block a user