* Some are no longer flaky or easily fixed * Some are out of date or test things we can't do accurately (scroll position) and are removed. * Unwinds some uppy tests and makes sure all promises and runloops are resolved. Everything has been run in legacy/ember cli multiple times to ensure no obvious suite regressions.
28 lines
894 B
JavaScript
28 lines
894 B
JavaScript
import { cacheBuster } from "discourse/lib/load-script";
|
|
import { module, test } from "qunit";
|
|
import { PUBLIC_JS_VERSIONS as jsVersions } from "discourse/lib/public-js-versions";
|
|
|
|
module("Unit | Utility | load-script", function () {
|
|
test("works when a value is not present", function (assert) {
|
|
assert.strictEqual(
|
|
cacheBuster("/javascripts/my-script.js"),
|
|
"/javascripts/my-script.js"
|
|
);
|
|
assert.strictEqual(
|
|
cacheBuster("/javascripts/my-project/script.js"),
|
|
"/javascripts/my-project/script.js"
|
|
);
|
|
});
|
|
|
|
test("generates URLs with version number in the query params", function (assert) {
|
|
assert.strictEqual(
|
|
cacheBuster("/javascripts/pikaday.js"),
|
|
`/javascripts/${jsVersions["pikaday.js"]}`
|
|
);
|
|
assert.strictEqual(
|
|
cacheBuster("/javascripts/ace/ace.js"),
|
|
`/javascripts/${jsVersions["ace/ace.js"]}`
|
|
);
|
|
});
|
|
});
|