From dae326cc758bf57768f1b27e1e1f2683280d728a Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Fri, 20 Dec 2024 13:47:29 -0500 Subject: [PATCH] `headerCommandPaletteButton` undefined when `JenkinsHeader` not loaded --- src/main/js/components/command-palette/index.js | 3 +++ test/src/test/java/lib/layout/LayoutTest.java | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/src/main/js/components/command-palette/index.js b/src/main/js/components/command-palette/index.js index ca2926d3422b..56ed7347fb72 100644 --- a/src/main/js/components/command-palette/index.js +++ b/src/main/js/components/command-palette/index.js @@ -13,6 +13,9 @@ function init() { const headerCommandPaletteButton = document.getElementById( "button-open-command-palette", ); + if (headerCommandPaletteButton === null) { + return; // no JenkinsHeader, no h:searchbox + } const commandPalette = document.getElementById("command-palette"); const commandPaletteWrapper = commandPalette.querySelector( ".jenkins-command-palette__wrapper", diff --git a/test/src/test/java/lib/layout/LayoutTest.java b/test/src/test/java/lib/layout/LayoutTest.java index 30d43cb545c2..0d1fe2f00bc8 100644 --- a/test/src/test/java/lib/layout/LayoutTest.java +++ b/test/src/test/java/lib/layout/LayoutTest.java @@ -53,4 +53,9 @@ public class LayoutTest { } } + @Test public void fullScreen() throws Exception { + // Example page using : + r.createWebClient().goTo("setupWizard/proxy-configuration"); + } + }