继续扩展共享可导航行
扩展 PlatformNavigableListItem 接入 profile 设置行 补充 profile 设置行的组件级与首页集成回归测试 更新 PlatformUiKit 收口计划与共享决策记录
This commit is contained in:
@@ -72,7 +72,10 @@ describe('PlatformProfilePrimitives', () => {
|
||||
</>,
|
||||
);
|
||||
|
||||
await user.click(screen.getByRole('button', { name: /通用设置/u }));
|
||||
const settingsButton = screen.getByRole('button', { name: /通用设置/u });
|
||||
expect(settingsButton.className).toContain('platform-navigable-list-item');
|
||||
|
||||
await user.click(settingsButton);
|
||||
expect(onSettingsClick).toHaveBeenCalledTimes(1);
|
||||
|
||||
await user.click(
|
||||
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
LEGAL_DOCUMENTS,
|
||||
type LegalDocumentId,
|
||||
} from '../common/legalDocuments';
|
||||
import { PlatformNavigableListItem } from '../common/PlatformNavigableListItem';
|
||||
|
||||
type ProfileStatCardProps = {
|
||||
cardKey: ProfileDashboardCardKey;
|
||||
@@ -119,21 +120,23 @@ export function ProfileSettingsRow({
|
||||
const Icon = icon;
|
||||
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
<PlatformNavigableListItem
|
||||
onClick={onClick}
|
||||
className="platform-profile-settings-row flex w-full items-center justify-between gap-3 px-4 py-3 text-left transition"
|
||||
>
|
||||
<span className="flex min-w-0 items-center gap-3">
|
||||
className="platform-profile-settings-row px-4 py-3 transition"
|
||||
leading={
|
||||
<span className="platform-profile-settings-row__icon">
|
||||
<Icon className="h-4 w-4" />
|
||||
</span>
|
||||
<span className="truncate text-[14px] font-semibold text-[var(--platform-text-strong)]">
|
||||
{label}
|
||||
</span>
|
||||
}
|
||||
bodyClassName="flex min-w-0 items-center"
|
||||
trailing={
|
||||
<ChevronRight className="h-4 w-4 shrink-0 text-[var(--platform-text-soft)]" />
|
||||
}
|
||||
>
|
||||
<span className="truncate text-[14px] font-semibold text-[var(--platform-text-strong)]">
|
||||
{label}
|
||||
</span>
|
||||
<ChevronRight className="h-4 w-4 shrink-0 text-[var(--platform-text-soft)]" />
|
||||
</button>
|
||||
</PlatformNavigableListItem>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -3027,6 +3027,9 @@ test('mobile profile page matches the reference layout sections', async () => {
|
||||
expect(
|
||||
within(settingsRegion).getByRole('button', { name: /通用设置/u }),
|
||||
).toBeTruthy();
|
||||
expect(
|
||||
within(settingsRegion).getByRole('button', { name: /通用设置/u }).className,
|
||||
).toContain('platform-navigable-list-item');
|
||||
expect(
|
||||
within(settingsRegion).queryByRole('button', { name: /主题设置/u }),
|
||||
).toBeNull();
|
||||
|
||||
Reference in New Issue
Block a user