diff --git a/app/assets/javascripts/admin.js.erb b/app/assets/javascripts/admin-plugins.js.erb
similarity index 84%
rename from app/assets/javascripts/admin.js.erb
rename to app/assets/javascripts/admin-plugins.js.erb
index dda57561778..70010c46443 100644
--- a/app/assets/javascripts/admin.js.erb
+++ b/app/assets/javascripts/admin-plugins.js.erb
@@ -1,6 +1,4 @@
<%
-require_asset("main_include_admin.js")
-
DiscoursePluginRegistry.admin_javascripts.each { |js| require_asset(js) }
DiscoursePluginRegistry.each_globbed_asset(admin: true) do |f|
diff --git a/app/assets/javascripts/admin.js b/app/assets/javascripts/admin.js
new file mode 100644
index 00000000000..3edc85a7d47
--- /dev/null
+++ b/app/assets/javascripts/admin.js
@@ -0,0 +1,2 @@
+//= require main_include_admin
+//= require admin-plugins
diff --git a/app/assets/javascripts/discourse/lib/bootstrap-json/index.js b/app/assets/javascripts/discourse/lib/bootstrap-json/index.js
index 3e989603399..c7a5e649fea 100644
--- a/app/assets/javascripts/discourse/lib/bootstrap-json/index.js
+++ b/app/assets/javascripts/discourse/lib/bootstrap-json/index.js
@@ -301,7 +301,10 @@ module.exports = {
contentFor: function (type, config) {
if (shouldLoadPluginTestJs() && type === "test-plugin-js") {
- return ``;
+ return `
+
+
+ `;
} else if (shouldLoadPluginTestJs() && type === "test-plugin-tests-js") {
return ``;
}
diff --git a/app/assets/javascripts/discourse/testem.js b/app/assets/javascripts/discourse/testem.js
index 04eaf41e4bd..8c5c5bf034c 100644
--- a/app/assets/javascripts/discourse/testem.js
+++ b/app/assets/javascripts/discourse/testem.js
@@ -59,6 +59,9 @@ if (shouldLoadPluginTestJs()) {
"/assets/discourse/tests/active-plugins.js": {
target,
},
+ "/assets/admin-plugins.js": {
+ target,
+ },
"/assets/discourse/tests/plugin-tests.js": {
target,
},
diff --git a/app/assets/javascripts/discourse/tests/index.html b/app/assets/javascripts/discourse/tests/index.html
index def3e68131e..98c7318aefd 100644
--- a/app/assets/javascripts/discourse/tests/index.html
+++ b/app/assets/javascripts/discourse/tests/index.html
@@ -50,8 +50,8 @@
- {{content-for "test-plugin-js"}}
+ {{content-for "test-plugin-js"}}
{{content-for "test-plugin-tests-js"}}
diff --git a/app/views/qunit/theme.html.erb b/app/views/qunit/theme.html.erb
index 30b9f1260f5..bbeede988c5 100644
--- a/app/views/qunit/theme.html.erb
+++ b/app/views/qunit/theme.html.erb
@@ -11,6 +11,7 @@
<%= preload_script @app_bundle %>
<%= preload_script "admin" %>
<%= preload_script "discourse/tests/active-plugins" %>
+ <%= preload_script "admin-plugins" %>
<%= support_bundles %>
<%= theme_translations_lookup %>
<%= theme_js_lookup %>
diff --git a/config/application.rb b/config/application.rb
index 437bbdf8362..1d9600d8173 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -177,6 +177,7 @@ module Discourse
onpopstate-handler.js
embed-application.js
discourse/tests/active-plugins.js
+ admin-plugins.js
discourse/tests/test_starter.js
}