mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-21 08:42:39 +00:00
test(app): measure sidebar rows one at a time
After a reload the developer error toast appears while expectVerticalOrder measures every row at once. Each concurrent boundingBox runs the toast locator handler, and only one of them resumes, so the poll timed out on every attempt since #7424. Measuring sequentially keeps one action in flight.
This commit is contained in:
@@ -149,9 +149,10 @@ async function expectVerticalOrder<Key extends string>(
|
|||||||
await expect
|
await expect
|
||||||
.poll(
|
.poll(
|
||||||
async () => {
|
async () => {
|
||||||
const measured = await Promise.all(
|
// One row at a time: concurrent actions that all run the developer toast handler do not
|
||||||
keys.map(async (key) => ({ key, top: await rowTop(locate(key)) })),
|
// all resume, and the poll then waits out its timeout.
|
||||||
);
|
const measured: { key: Key; top: number | null }[] = [];
|
||||||
|
for (const key of keys) measured.push({ key, top: await rowTop(locate(key)) });
|
||||||
if (!measured.every((entry): entry is { key: Key; top: number } => entry.top !== null))
|
if (!measured.every((entry): entry is { key: Key; top: number } => entry.top !== null))
|
||||||
return null;
|
return null;
|
||||||
return measured.sort((a, b) => a.top - b.top).map((entry) => entry.key);
|
return measured.sort((a, b) => a.top - b.top).map((entry) => entry.key);
|
||||||
|
|||||||
Reference in New Issue
Block a user