test(webui): retry the projects grouping click while the nav repaints (#1873)

The workspace nav repaints after async organization and project reads.
Under load (gate at load 14) a repaint landed between the flat-grouping
wait and the org click, and the click found no button. The click now
retries inside the wait until the page shows org grouping.
This commit was merged in pull request #1898.
This commit is contained in:
jason.woltje committed 2026-11-10 13:46:18 -06:00
1 parent aa087e7380
commit ac977d833b
1 file changed
+2 -1
@@ -172,7 +172,8 @@ test('Projects sorts and filters by each key, remembers the grouping, and rows o
await b.evaluate('location.reload()'); await b.evaluate('location.reload()');
await wait('document.querySelector("[data-ws-table]")?.dataset.grouping === "flat" && document.querySelectorAll("[data-ws-project]").length === 1 && document.querySelector("#workspace-nav [data-group=flat]")?.getAttribute("aria-pressed") === "true"'); await wait('document.querySelector("[data-ws-table]")?.dataset.grouping === "flat" && document.querySelectorAll("[data-ws-project]").length === 1 && document.querySelector("#workspace-nav [data-group=flat]")?.getAttribute("aria-pressed") === "true"');
// The sidebar's toggle switches this page back. // The sidebar's toggle switches this page back.
await b.evaluate('document.querySelector("#workspace-nav [data-group=org]").click()'); // The nav repaints after async reads, so the click retries until the page switches.
await wait('(document.querySelector("#workspace-nav [data-group=org]")?.click(), document.querySelector("[data-ws-table]")?.dataset.grouping === "org")');
await wait('document.querySelector("[data-ws-table]")?.dataset.grouping === "org" && document.querySelector("[data-ws-group=org]").getAttribute("aria-pressed") === "true"'); await wait('document.querySelector("[data-ws-table]")?.dataset.grouping === "org" && document.querySelector("[data-ws-group=org]").getAttribute("aria-pressed") === "true"');
}); });
const location = hash => decodeURIComponent(hash); const location = hash => decodeURIComponent(hash);