From feb5eda0d155acc3167ea7b0c693cb2385334dee Mon Sep 17 00:00:00 2001 From: Isaac Janzen <50783505+janzenisaac@users.noreply.github.com> Date: Tue, 28 Nov 2023 10:04:23 -0700 Subject: [PATCH] DEV: Make `theme-qunit` discoverable from `/tests` (#24606) https://github.com/discourse/discourse/assets/50783505/c6db8c35-1473-4ccd-aca2-bfb71af9e73e --- .../javascripts/discourse/tests/setup-tests.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/tests/setup-tests.js b/app/assets/javascripts/discourse/tests/setup-tests.js index 41015f11e31..19f647e2c50 100644 --- a/app/assets/javascripts/discourse/tests/setup-tests.js +++ b/app/assets/javascripts/discourse/tests/setup-tests.js @@ -149,7 +149,14 @@ function setupToolbar() { QUnit.config.urlConfig.push({ id: "target", label: "Target", - value: ["core", "plugins", "all", "-----", ...Array.from(pluginNames)], + value: [ + "core", + "plugins", + "all", + "theme-qunit", + "-----", + ...Array.from(pluginNames), + ], }); QUnit.begin(() => { @@ -375,6 +382,9 @@ export default function setupTests(config) { handleLegacyParameters(); const target = getUrlParameter("target") || "core"; + if (target === "theme-qunit") { + window.location.href = window.location.origin + "/theme-qunit"; + } const hasPluginJs = !!document.querySelector("script[data-discourse-plugin]"); const hasThemeJs = !!document.querySelector("script[data-theme-id]");