收口前端平台组件能力
新增 PlatformAsyncStatePanel 统一 profile 异步状态骨架 扩展 PlatformSegmentedTabs 支持滚动 tab 并接入创作入口与发现页 统一 PixelCloseButton 复用 PlatformModalCloseButton 像素关闭能力 抽取平台入口泥点前置提示弹层并收紧阻断语义 补充组件收口文档与共享决策记录
This commit is contained in:
@@ -162,3 +162,31 @@ test('supports auth-style tab semantics with underline tone', () => {
|
||||
|
||||
expect(onChange).toHaveBeenCalledWith('password');
|
||||
});
|
||||
|
||||
test('supports scroll layout for horizontal tabs', () => {
|
||||
render(
|
||||
<PlatformSegmentedTabs
|
||||
items={[
|
||||
{ id: 'recent', label: '最近创作' },
|
||||
{ id: 'rpg', label: '文字冒险' },
|
||||
{ id: 'jump-hop', label: '跳一跳' },
|
||||
]}
|
||||
activeId="recent"
|
||||
onChange={vi.fn()}
|
||||
layout="scroll"
|
||||
semantics="tabs"
|
||||
ariaLabel="创作入口页签"
|
||||
frame="bare"
|
||||
surface="transparent"
|
||||
className="pb-1"
|
||||
/>,
|
||||
);
|
||||
|
||||
const tablist = screen.getByRole('tablist', { name: '创作入口页签' });
|
||||
|
||||
expect(tablist.className).toContain('flex');
|
||||
expect(tablist.className).toContain('overflow-x-auto');
|
||||
expect(tablist.className).toContain('scrollbar-hide');
|
||||
expect(tablist.className).not.toContain('grid-cols-2');
|
||||
expect(tablist.className).toContain('pb-1');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user