This encompasses a lot of work done over the last year, much of which has already been merged into master. This is the final set of changes required to get Ember CLI running locally for development. From here on it will be bug fixes / enhancements. Co-authored-by: Jarek Radosz <jradosz@gmail.com> Co-authored-by: romanrizzi <rizziromanalejandro@gmail.com> Co-authored-by: Jarek Radosz <jradosz@gmail.com> Co-authored-by: romanrizzi <rizziromanalejandro@gmail.com>
35 lines
1.0 KiB
JavaScript
35 lines
1.0 KiB
JavaScript
import { discourseModule } from "discourse/tests/helpers/qunit-helpers";
|
|
import { test } from "qunit";
|
|
|
|
discourseModule("Unit | Controller | preferences/account", function () {
|
|
test("updating of associated accounts", function (assert) {
|
|
const controller = this.getController("preferences/account", {
|
|
siteSettings: {
|
|
enable_google_oauth2_logins: true,
|
|
},
|
|
model: {
|
|
id: 70,
|
|
second_factor_enabled: true,
|
|
is_anonymous: true,
|
|
},
|
|
currentUser: {
|
|
id: 1234,
|
|
},
|
|
site: {
|
|
isMobileDevice: false,
|
|
},
|
|
});
|
|
|
|
assert.equal(controller.get("canUpdateAssociatedAccounts"), false);
|
|
|
|
controller.set("model.second_factor_enabled", false);
|
|
assert.equal(controller.get("canUpdateAssociatedAccounts"), false);
|
|
|
|
controller.set("model.is_anonymous", false);
|
|
assert.equal(controller.get("canUpdateAssociatedAccounts"), false);
|
|
|
|
controller.set("model.id", 1234);
|
|
assert.equal(controller.get("canUpdateAssociatedAccounts"), true);
|
|
});
|
|
});
|