test(desktop): await responsive state after native viewport reset
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user