收口顶栏钱包快捷入口

复用 PlatformActionButton 和 PlatformIconBadge 收口创作与草稿顶栏钱包快捷入口
补强钱包快捷入口在移动端与桌面端的回归测试
更新 PlatformUiKit 收口计划和 Hermes 决策记录
This commit is contained in:
2026-06-10 16:51:40 +08:00
parent 9141540c37
commit 9a04ea55dc
4 changed files with 86 additions and 33 deletions

View File

@@ -3535,24 +3535,37 @@ test('logged in create tab shows real wallet balance beside the brand', () => {
const topbar = container.querySelector('.platform-mobile-topbar');
expect(topbar).toBeTruthy();
expect(
topbar?.querySelector('.platform-mobile-create-wallet-chip'),
within(topbar as HTMLElement).getByRole('img', {
name: / GENARRATIVE/u,
}),
).toBeTruthy();
expect(topbar?.textContent).toContain('陶泥儿');
expect(topbar?.textContent).toContain('1,234泥点');
const walletButton = within(topbar as HTMLElement).getByRole('button', {
name: /^1,234$/u,
});
expect(walletButton.className).toContain('platform-mobile-create-wallet-chip');
expect(walletButton.className).toContain('platform-action-button--accent-soft');
expect(walletButton.querySelector('.platform-icon-badge')).toBeTruthy();
});
test('create tab wallet chip opens reward code when recharge entry is hidden', async () => {
const user = userEvent.setup();
mockNarrowMobileLayout();
render(
const { container } = render(
<ProfileHomeViewHarness
activeTab="create"
profileDashboardOverrides={{ walletBalance: 70 }}
/>,
);
await user.click(screen.getByRole('button', { name: /^70$/u }));
const topbar = container.querySelector('.platform-mobile-topbar');
expect(topbar).toBeTruthy();
await user.click(
within(topbar as HTMLElement).getByRole('button', { name: /^70$/u }),
);
expect(await screen.findByPlaceholderText('输入兑换码')).toBeTruthy();
expect(mockGetRpgProfileRechargeCenter).not.toHaveBeenCalled();
@@ -3562,14 +3575,25 @@ test('create tab wallet chip opens recharge when recharge entry is enabled', asy
const user = userEvent.setup();
mockWechatDesktopLayout();
render(
const { container } = render(
<ProfileHomeViewHarness
activeTab="create"
profileDashboardOverrides={{ walletBalance: 70 }}
/>,
);
await user.click(screen.getByRole('button', { name: /^70$/u }));
const topbar = container.querySelector('.platform-desktop-topbar');
expect(topbar).toBeTruthy();
const walletButton = within(topbar as HTMLElement).getByRole('button', {
name: /^70$/u,
});
expect(walletButton.className).toContain('platform-desktop-create-wallet-chip');
expect(walletButton.className).toContain('platform-desktop-search');
expect(walletButton.className).toContain('platform-action-button--accent-soft');
expect(walletButton.querySelector('.platform-icon-badge')).toBeTruthy();
await user.click(walletButton);
expect(await screen.findByText('账户充值')).toBeTruthy();
expect(mockGetRpgProfileRechargeCenter).toHaveBeenCalledTimes(1);