mirror of
https://github.com/discourse/discourse.git
synced 2024-12-15 20:03:44 +08:00
33 lines
867 B
JavaScript
33 lines
867 B
JavaScript
moduleFor("controller:preferences/account");
|
|
|
|
QUnit.test("updating of associated accounts", function(assert) {
|
|
const controller = this.subject({
|
|
siteSettings: {
|
|
enable_google_oauth2_logins: true
|
|
},
|
|
model: Ember.Object.create({
|
|
second_factor_enabled: true,
|
|
is_anonymous: true
|
|
}),
|
|
site: Ember.Object.create({
|
|
isMobileDevice: false
|
|
})
|
|
});
|
|
|
|
controller.set("canCheckEmails", 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("canCheckEmails", true);
|
|
|
|
assert.equal(controller.get("canUpdateAssociatedAccounts"), true);
|
|
});
|