DEV: Make `theme-qunit` discoverable from `/tests` (#24606)

https://github.com/discourse/discourse/assets/50783505/c6db8c35-1473-4ccd-aca2-bfb71af9e73e
This commit is contained in:
Isaac Janzen 2023-11-28 10:04:23 -07:00 committed by GitHub
parent d7f618807e
commit feb5eda0d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 1 deletions

View File

@ -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]");