2018-09-30 22:06:01 -04:00
|
|
|
import loadScript from "discourse/lib/load-script";
|
|
|
|
|
|
|
|
QUnit.module("lib:load-script");
|
|
|
|
|
2019-06-27 04:57:40 -04:00
|
|
|
QUnit.skip(
|
2018-09-30 22:06:01 -04:00
|
|
|
"load with a script tag, and callbacks are only executed after script is loaded",
|
|
|
|
async assert => {
|
2019-06-27 04:19:55 -04:00
|
|
|
assert.ok(
|
|
|
|
typeof window.ace === "undefined",
|
|
|
|
"ensures ace is not previously loaded"
|
|
|
|
);
|
|
|
|
|
2018-09-30 22:06:01 -04:00
|
|
|
const src = "/javascripts/ace/ace.js";
|
|
|
|
|
2020-03-02 15:20:19 -05:00
|
|
|
await loadScript(src);
|
|
|
|
assert.ok(
|
|
|
|
typeof window.ace !== "undefined",
|
|
|
|
"callbacks should only be executed after the script has fully loaded"
|
|
|
|
);
|
2018-09-30 22:06:01 -04:00
|
|
|
}
|
|
|
|
);
|