test(desktop): await responsive state after native viewport reset

This commit is contained in:
Agent Workbench Dev
2026-10-31 19:41:47 +08:00
parent 65ef65bacb
commit 52f0d20f56
34 changed files with 53289 additions and 0 deletions
+4
View File
@@ -97,6 +97,10 @@ export async function desktopProjectQa({ store, provider, runtime, sample, kind
assert.equal(await page.evaluate(() => document.documentElement.scrollWidth > innerWidth), false); screenshots.push({ file: filename, width, sha256: hash(fs.readFileSync(filename)) });
}
await (await application.browserWindow(page)).evaluate(value => value.setContentSize(1440, 1000));
// Electron resize and React's responsive state settle independently.
// Await both before querying a control whose accessible name changes.
await expect.poll(() => page.evaluate(() => innerWidth)).toBe(1440);
await expect(page.getByRole('button', { name: '关闭检视区', exact: true })).toBeHidden();
await page.keyboard.press('Escape'); await expect(page.getByRole('dialog', { name: '隔离协作', exact: true })).toBeHidden();
await closeInspector();
}