diff --git a/e2e/remediation-flows.spec.ts b/e2e/remediation-flows.spec.ts index 2c59941..b9410be 100644 --- a/e2e/remediation-flows.spec.ts +++ b/e2e/remediation-flows.spec.ts @@ -41,7 +41,18 @@ test('F06 已验收工单返工:归档旧验收 → 再完成 → 再验收', await page.keyboard.press('Escape'); await navigate(page, '/components/signature'); await page.getByRole('combobox').first().click(); - await page.locator('.ant-select-item-option', { hasText: 'WO-SCN-REWORK' }).click(); + // 候选按创建时间倒序,下拉是虚拟列表(只渲染可视的约 10 项)。排在这张工单前面的近期工单数随当天时刻 + // 与时区变化(演示数据按本地自然日生成;CI 为 UTC 时它常落在第 10 项之后),用滚轮逐屏翻到它渲染出来再点 + const option = page.locator('.ant-select-item-option', { hasText: 'WO-SCN-REWORK' }); + const dropdown = page.locator('.ant-select-dropdown:visible'); + await expect(async () => { + if (!(await option.count())) { + await dropdown.hover(); + await page.mouse.wheel(0, 240); + } + await expect(option).toBeVisible({ timeout: 500 }); + }).toPass({ timeout: 15_000 }); + await option.click(); // getByText 会先命中 select 的 aria-live 隐藏区,断言可见的选中项 await expect(page.locator('.ant-select', { hasText: 'WO-SCN-REWORK' }).first()).toBeVisible(); }); diff --git a/src/components/GroupNav/index.test.tsx b/src/components/GroupNav/index.test.tsx index 477b643..216cd10 100644 --- a/src/components/GroupNav/index.test.tsx +++ b/src/components/GroupNav/index.test.tsx @@ -21,6 +21,7 @@ vi.mock('@umijs/max', () => ({ vi.mock('antd', async () => { const React = await import('react'); return { + ConfigProvider: ({ children }: { children?: React.ReactNode }) => children, Menu: (props: { selectedKeys?: string[]; items?: { key: string; label?: string }[] }) => { menuProps.last = props; return React.createElement( diff --git a/src/components/GroupNav/index.tsx b/src/components/GroupNav/index.tsx index 529033d..4152462 100644 --- a/src/components/GroupNav/index.tsx +++ b/src/components/GroupNav/index.tsx @@ -1,6 +1,6 @@ import { canAccessRoute, groupOf, matchedKey, useNamedChain, type NavRoute } from '@/utils/routeNav'; import { history, useAccess, useIntl, useLocation } from '@umijs/max'; -import { Menu, theme } from 'antd'; +import { ConfigProvider, Menu, theme } from 'antd'; import { useEffect, useRef } from 'react'; /** @@ -71,24 +71,29 @@ export default function GroupNav() { }} >
- { - if (key !== pathname) { - history.push(key); - window.scrollTo(0, 0); - } - }} - style={{ - borderBottom: 'none', - background: 'transparent', - minWidth: 0, - lineHeight: '40px', - }} - /> + {/* 选中页签文字(及底部指示条)antd 默认取 colorPrimary:暗色派生 #1668dc 压在 #141414 上只有 3.55:1 + (axe color-contrast)。改用 colorLink:浅色两者同为 #0958d9 不变,暗色为 #5c99dc 6.18:1 + (见 styles/themeTokens.ts)。取运行时 token 而非写死色值,冷启动与顶栏热切换都跟随当前主题 */} + + { + if (key !== pathname) { + history.push(key); + window.scrollTo(0, 0); + } + }} + style={{ + borderBottom: 'none', + background: 'transparent', + minWidth: 0, + lineHeight: '40px', + }} + /> +
占位撑开 56px, + * 它和顶栏都是页面级
,读屏器的地标列表里多出一个空「横幅」(axe landmark-no-duplicate-banner / + * landmark-unique)。组件没有给占位传属性的口子:visibility: hidden 把它移出无障碍树,而盒子高度照旧 + * 占位(visibility 不影响布局);它本来就是透明空元素,视觉无变化。 + */ +header.ant-layout-header:has(+ header[data-testid='pro-layout-header']) { + visibility: hidden; +}