2018-09-03 19:42:39 -05:00
|
|
|
moduleFor("controller:preferences/account");
|
|
|
|
|
2019-04-17 03:05:02 -05:00
|
|
|
QUnit.test("updating of associated accounts", function(assert) {
|
2018-09-03 19:42:39 -05:00
|
|
|
const controller = this.subject({
|
|
|
|
siteSettings: {
|
|
|
|
enable_google_oauth2_logins: true
|
|
|
|
},
|
2019-01-11 10:54:23 -06:00
|
|
|
model: Ember.Object.create({
|
2019-04-17 03:05:02 -05:00
|
|
|
second_factor_enabled: true,
|
|
|
|
is_anonymous: true
|
2018-09-03 19:42:39 -05:00
|
|
|
}),
|
2019-01-11 10:54:23 -06:00
|
|
|
site: Ember.Object.create({
|
2018-09-03 19:42:39 -05:00
|
|
|
isMobileDevice: false
|
|
|
|
})
|
|
|
|
});
|
|
|
|
|
2019-02-26 09:49:29 -06:00
|
|
|
controller.set("canCheckEmails", false);
|
|
|
|
|
2018-09-03 19:42:39 -05:00
|
|
|
assert.equal(controller.get("canUpdateAssociatedAccounts"), false);
|
|
|
|
|
|
|
|
controller.set("model.second_factor_enabled", false);
|
|
|
|
|
2019-02-26 02:19:27 -06:00
|
|
|
assert.equal(controller.get("canUpdateAssociatedAccounts"), false);
|
|
|
|
|
2019-04-17 03:05:02 -05:00
|
|
|
controller.set("model.is_anonymous", false);
|
|
|
|
|
|
|
|
assert.equal(controller.get("canUpdateAssociatedAccounts"), false);
|
|
|
|
|
2019-02-26 09:49:29 -06:00
|
|
|
controller.set("canCheckEmails", true);
|
2019-02-26 02:19:27 -06:00
|
|
|
|
2018-09-03 19:42:39 -05:00
|
|
|
assert.equal(controller.get("canUpdateAssociatedAccounts"), true);
|
|
|
|
});
|