收口个人中心充值商品卡组件
个人中心充值商品整卡按钮改用 PlatformSubpanel as button 充值弹窗测试断言商品卡接入公共交互壳 补充 PlatformUiKit 收口文档和 Hermes 决策记录
This commit is contained in:
@@ -1446,7 +1446,17 @@ test('profile recharge modal trusts per-product first bonus display after points
|
||||
|
||||
const rechargeDialog = await screen.findByText('账户充值');
|
||||
expect(rechargeDialog).toBeTruthy();
|
||||
expect(screen.getByRole('button', { name: /60泥点/u })).toBeTruthy();
|
||||
const rechargeProductCard = screen.getByRole('button', {
|
||||
name: /60泥点.*60\+60泥点.*购买/u,
|
||||
});
|
||||
|
||||
expect(rechargeProductCard.className).toContain('platform-subpanel');
|
||||
expect(rechargeProductCard.className).toContain('platform-interactive-card');
|
||||
expect(rechargeProductCard.className).toContain('hover:bg-white');
|
||||
expect(rechargeProductCard.getAttribute('type')).toBe('button');
|
||||
expect(rechargeProductCard.className).toContain(
|
||||
'disabled:cursor-not-allowed',
|
||||
);
|
||||
expect(screen.getByText('首充双倍')).toBeTruthy();
|
||||
expect(screen.getByText('60+60泥点')).toBeTruthy();
|
||||
});
|
||||
|
||||
@@ -3070,11 +3070,16 @@ function RechargeProductCard({
|
||||
const value = buildRechargeProductValueLabel(product);
|
||||
|
||||
return (
|
||||
<button
|
||||
<PlatformSubpanel
|
||||
as="button"
|
||||
type="button"
|
||||
surface="platform"
|
||||
onClick={() => onBuy(product)}
|
||||
disabled={Boolean(submittingProductId)}
|
||||
className="platform-subpanel platform-interactive-card relative min-h-[7.25rem] rounded-[1.15rem] px-3.5 py-3.5 text-left disabled:cursor-not-allowed disabled:opacity-60"
|
||||
interactive
|
||||
radius="sm"
|
||||
padding="none"
|
||||
className="platform-interactive-card relative min-h-[7.25rem] px-3.5 py-3.5 text-left"
|
||||
>
|
||||
{badgeLabel ? (
|
||||
<PlatformPillBadge
|
||||
@@ -3099,7 +3104,7 @@ function RechargeProductCard({
|
||||
{submitting ? '处理中' : '购买'}
|
||||
</span>
|
||||
</div>
|
||||
</button>
|
||||
</PlatformSubpanel>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user