Revert "FEATURE: Introduce theme/component QUnit tests (#12517)" (#12632)

This reverts commit a53d8d3e61 and 105634435f.

Reverted because the change broke some components. Will be added back in a few days.
This commit is contained in:
Osama Sayegh
2021-04-07 17:45:49 +03:00
committed by GitHub
parent 68a032a734
commit 2b9ab3a0d9
24 changed files with 165 additions and 419 deletions

View File

@ -8,7 +8,7 @@ class ThemeJavascriptsController < ApplicationController
:preload_json,
:redirect_to_login_if_required,
:verify_authenticity_token,
only: [:show, :show_tests]
only: [:show]
)
before_action :is_asset_path, :no_cookies, :apply_cdn_headers, only: [:show]
@ -34,29 +34,6 @@ class ThemeJavascriptsController < ApplicationController
send_file(cache_file, disposition: :inline)
end
def show_tests
raise Discourse::NotFound if Rails.env.production?
theme_id = params.require(:theme_id)
theme = Theme.find(theme_id)
content = ThemeField
.where(
theme_id: theme_id,
target_id: Theme.targets[:tests_js]
)
.each(&:ensure_baked!)
.map(&:value_baked)
.join("\n")
ThemeJavascriptCompiler.force_default_settings(content, theme)
response.headers["Content-Length"] = content.size.to_s
response.headers["Last-Modified"] = Time.zone.now.httpdate
immutable_for(1.second)
send_data content, filename: "js-tests-theme-#{theme_id}.js", disposition: :inline
end
private
def query