From ac977d833b36ce3e0a96ff7fe0f2a6c806aea7cc Mon Sep 17 00:00:00 2001 From: Jason Woltje Date: Tue, 10 Nov 2026 13:46:18 -0600 Subject: [PATCH] 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. --- packages/webui/tests/workspace-pages-browser.test.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/webui/tests/workspace-pages-browser.test.mjs b/packages/webui/tests/workspace-pages-browser.test.mjs index 7073bde2d..eb4d753d7 100644 --- a/packages/webui/tests/workspace-pages-browser.test.mjs +++ b/packages/webui/tests/workspace-pages-browser.test.mjs @@ -172,7 +172,8 @@ test('Projects sorts and filters by each key, remembers the grouping, and rows o 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"'); // 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"'); }); const location = hash => decodeURIComponent(hash);