From 524132b42b3423a59b121c500fe49fcc6dd19797 Mon Sep 17 00:00:00 2001 From: Jason Woltje Date: Thu, 19 Nov 2026 18:47:38 -0600 Subject: [PATCH] test(webui): settings-s4 review F1: each organization pick waits for the picker and changes it in one step, since a route change repaints the select; the final gate caught the select missing for a moment between a wait and the pick; the test still fails with the bus.js and display.js of e717824c5 (#1873, lane settings-s4) --- packages/webui/tests/settings-s4-browser.test.mjs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/webui/tests/settings-s4-browser.test.mjs b/packages/webui/tests/settings-s4-browser.test.mjs index 4e05bc2f0..cbac26670 100644 --- a/packages/webui/tests/settings-s4-browser.test.mjs +++ b/packages/webui/tests/settings-s4-browser.test.mjs @@ -159,17 +159,19 @@ test('settings-s4: the sidebar marks an organization paused while the model serv // settings-s4 review F1: the picker on a page that is not an organization's keeps the #/settings/ base. test('settings-s4 review F1: picking an organization from Model setup opens its Routing page at #/settings/routing?org=', { timeout: 90000 }, async t => { const { b, wait } = await orgSetup(t, { path: '/#/settings/model-setup' }); + // A route change repaints the picker, so the pick waits for the select and changes it in one step. + const pick = id => wait(`(() => { const s = document.querySelector("#org-pick"); if (!s || ![...s.options].some(o => o.value === "${id}")) return false; s.value = "${id}"; s.dispatchEvent(new Event("change", { bubbles: true })); return true; })()`); await wait('document.querySelector("#org-pick") && document.querySelector("#proxy-setup")'); - await b.evaluate('(() => { const s = document.querySelector("#org-pick"); s.value = "north"; s.dispatchEvent(new Event("change", { bubbles: true })); return true; })()'); + await pick('north'); await wait('location.hash === "#/settings/routing?org=north" && document.querySelector("#settings-nav a[href=\'#/settings/routing?org=north\'][aria-current=page]")'); await wait('/North Works/.test(document.querySelector("#breadcrumbs")?.textContent ?? "")'); assert.equal(await b.evaluate('location.hash.includes("#/orgs/")'), false); for (const from of ['appearance', 'organizations']) { await b.evaluate(`location.hash = "#/settings/${from}"; true`); await wait(`document.querySelector("#settings-nav a[href='#/settings/${from}'][aria-current=page]") && document.querySelector("#org-pick")`); - await b.evaluate('(() => { const s = document.querySelector("#org-pick"); s.value = "acme"; s.dispatchEvent(new Event("change", { bubbles: true })); return true; })()'); + await pick('acme'); await wait('location.hash === "#/settings/routing?org=acme" && document.querySelector("#org-pick")?.value === "acme"'); - await b.evaluate('(() => { const s = document.querySelector("#org-pick"); s.value = "north"; s.dispatchEvent(new Event("change", { bubbles: true })); return true; })()'); + await pick('north'); await wait('location.hash === "#/settings/routing?org=north"'); } });