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:
Mohamed Boudra
2026-10-20 09:37:54 +02:00
parent 6971bb5788
commit 41ac23016d
@@ -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);