REFACTOR: Removes `Discourse.SiteSettings` constant from tests

This does not work in the Ember CLI world.
This commit is contained in:
Robin Ward 2020-10-05 13:15:26 -04:00
parent a4356b99af
commit 4dec7d85d0
2 changed files with 5 additions and 3 deletions

View File

@ -101,7 +101,6 @@ const ORIGINAL_SETTINGS = {
}; };
let siteSettings = Object.assign({}, ORIGINAL_SETTINGS); let siteSettings = Object.assign({}, ORIGINAL_SETTINGS);
Discourse.SiteSettings = siteSettings;
export function currentSettings() { export function currentSettings() {
return siteSettings; return siteSettings;

View File

@ -45,8 +45,10 @@
//= require jquery.magnific-popup.min.js //= require jquery.magnific-popup.min.js
let App = window.Discourse; let App = window.Discourse;
let resetSettings = require("discourse/tests/helpers/site-settings") let {
.resetSettings; resetSettings,
currentSettings,
} = require("discourse/tests/helpers/site-settings");
let createHelperContext = require("discourse-common/lib/helpers") let createHelperContext = require("discourse-common/lib/helpers")
.createHelperContext; .createHelperContext;
@ -78,6 +80,7 @@ d.write(
App.rootElement = "#ember-testing"; App.rootElement = "#ember-testing";
App.setupForTesting(); App.setupForTesting();
App.injectTestHelpers(); App.injectTestHelpers();
App.SiteSettings = currentSettings();
App.start(); App.start();
// disable logster error reporting // disable logster error reporting