Peach: Local-first video metadata scraper and media manager.
fix(test): 按表格导航顺序验证键盘列宽
longmeidaofcc7da217d4d
diff --git a/docs/TESTING.md b/docs/TESTING.mdindex 36e643ce4..6b89e20f6 100644--- a/docs/TESTING.md+++ b/docs/TESTING.md@@ -209,6 +209,8 @@ Windows 的 `-Focus` 接受 Python 模块、类、方法或仓库相对路径,浏览器冒烟逐个文件执行,一个文件失败仍跑完其余文件,最后把各失败文件的输出与日志路径一起报出;一轮全量就能看到所有 e2e 失败。搜索建议、键盘列宽调整和嵌套弹层的失败输出另保留当时的输入、焦点、弹层、等待态与无障碍树,原异常作为 cause 保留。取证不延长等待、不重试交互,也不忽略运行期错误。+React Aria 表格首次取得焦点时先建立行导航。键盘列宽测试先进入行并确认公开焦点状态,再聚焦手柄,核对真实 `activeElement` 后按 Enter;不把直接调用 `focus()` 已返回当成焦点仍在手柄的证明,也不用等待时长或重复按键消除竞态。+定向调试 Python 回归:```powershelldiff --git a/frontend/e2e/table-preferences-fixture.ts b/frontend/e2e/table-preferences-fixture.tsindex 4f75bb73a..1befc90d0 100644--- a/frontend/e2e/table-preferences-fixture.ts+++ b/frontend/e2e/table-preferences-fixture.ts@@ -60,9 +60,16 @@ export async function verifyTablePreferences(page: Page, table: Locator, label:const width = async () => header.evaluate(node => node.getBoundingClientRect().width);const initial = await width();const handle = header.getByRole('slider');- await handle.focus(); await handle.press('Enter');- await withPageDiagnostics(page, `${label}进入键盘列宽调整`,- () => header.locator('.react-aria-ColumnResizer[data-resizing]').waitFor());+ await withPageDiagnostics(page, `${label}进入键盘列宽调整`, async () => {+ // React Aria 首次进入集合会先聚焦行导航;确认该状态后再移入列宽手柄。+ await table.locator('tbody tr').first().focus();+ await table.locator('tbody tr[data-focused]').first().waitFor();+ await handle.focus();+ assert.equal(await handle.evaluate(node => document.activeElement === node), true,+ `${label}键盘调整前焦点必须位于列宽手柄`);+ await handle.press('Enter');+ await header.locator('.react-aria-ColumnResizer[data-resizing]').waitFor();+ });await handle.press('ArrowRight'); await handle.press('ArrowRight');await page.waitForFunction(({ node, initial }) => node && node.getBoundingClientRect().width > initial,{ node: await header.elementHandle(), initial }, { timeout: 5000 });