DEV: avoids using document.write (#13858)
It doesn’t provide much than just avoiding some logs in tests. I didn't change test_starter as it's going to be removed at some point.
This commit is contained in:
parent
29e71f8450
commit
32d0467881
|
@ -8,14 +8,16 @@ document.addEventListener("discourse-booted", () => {
|
||||||
let setupTests = require("discourse/tests/setup-tests").default;
|
let setupTests = require("discourse/tests/setup-tests").default;
|
||||||
Ember.ENV.LOG_STACKTRACE_ON_DEPRECATION = false;
|
Ember.ENV.LOG_STACKTRACE_ON_DEPRECATION = false;
|
||||||
|
|
||||||
document.write(`
|
document.body.insertAdjacentHTML(
|
||||||
<div id="qunit"></div>
|
"afterbegin",
|
||||||
<div id="qunit-fixture"></div>
|
`
|
||||||
|
<div id="qunit"></div>
|
||||||
<div id="ember-testing-container" style='position: fixed'>
|
<div id="qunit-fixture"></div>
|
||||||
<div id="ember-testing"></div>
|
<div id="ember-testing-container" style="position: fixed">
|
||||||
</div>
|
<div id="ember-testing"></div>
|
||||||
`);
|
</div>
|
||||||
|
`
|
||||||
|
);
|
||||||
|
|
||||||
setupTests(config.APP);
|
setupTests(config.APP);
|
||||||
start({ setupTestContainer: false });
|
start({ setupTestContainer: false });
|
||||||
|
|
|
@ -24,14 +24,15 @@
|
||||||
//= require ./wizard-pretender
|
//= require ./wizard-pretender
|
||||||
//= require test-shims
|
//= require test-shims
|
||||||
|
|
||||||
// Trick JSHint into allow document.write
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
let d = document;
|
document.body.insertAdjacentHTML(
|
||||||
d.write(
|
"afterbegin",
|
||||||
'<div id="ember-testing-container"><div id="ember-testing"></div></div>'
|
`
|
||||||
);
|
<div id="ember-testing-container"><div id="ember-testing"></div></div>
|
||||||
d.write(
|
<style>#ember-testing-container { position: absolute; background: white; bottom: 0; right: 0; width: 640px; height: 384px; overflow: auto; z-index: 9999; border: 1px solid #ccc; } #ember-testing { zoom: 50%; }</style>
|
||||||
"<style>#ember-testing-container { position: absolute; background: white; bottom: 0; right: 0; width: 640px; height: 384px; overflow: auto; z-index: 9999; border: 1px solid #ccc; } #ember-testing { zoom: 50%; }</style>"
|
`
|
||||||
);
|
);
|
||||||
|
});
|
||||||
|
|
||||||
if (window.Logster) {
|
if (window.Logster) {
|
||||||
Logster.enabled = false;
|
Logster.enabled = false;
|
||||||
|
|
Loading…
Reference in New Issue