2021-04-12 07:02:58 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module QunitHelper
|
|
|
|
def theme_tests
|
2021-06-15 01:57:17 -05:00
|
|
|
theme = Theme.find_by(id: request.env[:resolved_theme_id])
|
2021-04-28 15:12:08 -05:00
|
|
|
return "" if theme.blank?
|
2021-04-12 07:02:58 -05:00
|
|
|
|
2021-04-28 15:12:08 -05:00
|
|
|
_, digest = theme.baked_js_tests_with_digest
|
|
|
|
src = "#{GlobalSetting.cdn_url}" \
|
|
|
|
"#{Discourse.base_path}" \
|
|
|
|
"/theme-javascripts/tests/#{theme.id}-#{digest}.js" \
|
|
|
|
"?__ws=#{Discourse.current_hostname}"
|
2022-06-20 23:44:31 -05:00
|
|
|
"<script defer src='#{src}'></script>".html_safe
|
2021-04-12 07:02:58 -05:00
|
|
|
end
|
|
|
|
end
|