discourse/test/javascripts/controllers/preferences-account-test.js.es6

33 lines
867 B
Plaintext
Raw Normal View History

moduleFor("controller:preferences/account");
QUnit.test("updating of associated accounts", function(assert) {
const controller = this.subject({
siteSettings: {
enable_google_oauth2_logins: true
},
2019-01-11 10:54:23 -06:00
model: Ember.Object.create({
second_factor_enabled: true,
is_anonymous: true
}),
2019-01-11 10:54:23 -06:00
site: Ember.Object.create({
isMobileDevice: false
})
});
2019-02-26 09:49:29 -06:00
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);
2019-02-26 09:49:29 -06:00
controller.set("canCheckEmails", true);
assert.equal(controller.get("canUpdateAssociatedAccounts"), true);
});