diff --git a/src/engineering_platform/assets/dashboard.js b/src/engineering_platform/assets/dashboard.js index 30b8bda5..424b487d 100644 --- a/src/engineering_platform/assets/dashboard.js +++ b/src/engineering_platform/assets/dashboard.js @@ -4774,6 +4774,7 @@ function populateLogComponentFilter(model = latestPlatformHealth?.component_mode select.replaceChildren(new Option(t("filter.all_ep_components"), "")); model.forEach((component) => select.append(new Option(t(component.name_key), component.id))); select.value = [...select.options].some((option) => option.value === selected) ? selected : ""; + syncDashboardSelectPicker(select); } function refreshComponentLogsForFilters() { independentLogPageStates.platform = 1; diff --git a/tests/engineering/dashboard.spec.mjs b/tests/engineering/dashboard.spec.mjs index 2e0b2631..797c1517 100644 --- a/tests/engineering/dashboard.spec.mjs +++ b/tests/engineering/dashboard.spec.mjs @@ -1068,6 +1068,20 @@ test.describe("Engineering Status browser smoke", () => { await expect(picker.locator("[role=option]")).toHaveText(["Informatie", "Debug"]); }); + test("fills the component log picker from the initial platform-health model", async ({ page }) => { + await page.goto(dashboardUrl, { waitUntil: "domcontentloaded" }); + await waitForDashboardReady(page); + const select = page.locator("#logComponentFilter"); + const nativeOptionCount = await select.locator("option").count(); + expect(nativeOptionCount).toBeGreaterThan(1); + await page.locator("#componentLogs").evaluate((element) => { element.open = true; }); + const picker = select.locator("+ .dashboard-select-picker"); + await openDashboardPicker(picker); + await expect(picker.locator("[role=option]")).toHaveCount(nativeOptionCount); + await expect(picker.locator('[data-dashboard-select-value="ep_server"]')).toBeVisible(); + await expect(picker.locator('[data-dashboard-select-value="file_inbox_ingress"]')).toBeVisible(); + }); + test("does not move focus after a pointer chooses a log-settings pulldown value", async ({ page }) => { await page.goto(dashboardUrl, { waitUntil: "domcontentloaded" }); await waitForDashboardReady(page);