mirror of
https://github.com/discourse/discourse.git
synced 2025-06-19 19:31:38 +08:00
Revert "Rename all test files from JS -> ES6"
This reverts commit 2abe85b8344de1102c1589a9ac9421a8b296f2b5.
This commit is contained in:
41
test/javascripts/controllers/avatar-selector-test.js.es6
Normal file
41
test/javascripts/controllers/avatar-selector-test.js.es6
Normal file
@ -0,0 +1,41 @@
|
||||
import { mapRoutes } from "discourse/mapping-router";
|
||||
|
||||
moduleFor("controller:avatar-selector", "controller:avatar-selector", {
|
||||
beforeEach() {
|
||||
this.registry.register("router:main", mapRoutes());
|
||||
},
|
||||
needs: ["controller:modal"]
|
||||
});
|
||||
|
||||
QUnit.test("avatarTemplate", function(assert) {
|
||||
const avatarSelectorController = this.subject();
|
||||
|
||||
avatarSelectorController.setProperties({
|
||||
selected: "system",
|
||||
user: {
|
||||
system_avatar_upload_id: 1,
|
||||
gravatar_avatar_upload_id: 2,
|
||||
custom_avatar_upload_id: 3
|
||||
}
|
||||
});
|
||||
|
||||
assert.equal(
|
||||
avatarSelectorController.get("selectedUploadId"),
|
||||
1,
|
||||
"we are using system by default"
|
||||
);
|
||||
|
||||
avatarSelectorController.set("selected", "gravatar");
|
||||
assert.equal(
|
||||
avatarSelectorController.get("selectedUploadId"),
|
||||
2,
|
||||
"we are using gravatar when set"
|
||||
);
|
||||
|
||||
avatarSelectorController.set("selected", "custom");
|
||||
assert.equal(
|
||||
avatarSelectorController.get("selectedUploadId"),
|
||||
3,
|
||||
"we are using custom when set"
|
||||
);
|
||||
});
|
Reference in New Issue
Block a user