reconTests.js revision 7ed4684789d023e1d4ede1b0d4468b9724587466
0N/A "../mocks/reconPolicyMappings"
// These three constants come from MappingBaseView and are the arguments passed into the SituationPolicyView render function.
var sync = [{"target":"managed/user","properties":[{"target":"displayName","source":"cn"},{"target":"description","source":"description"},{"target":"givenName","source":"givenName"},{"target":"mail","source":"mail"},{"target":"telephoneNumber","source":"telephoneNumber"},{"target":"sn","source":"sn"},{"target":"userName","source":"uid"}],"source":"system/ldap/account","policies":[{"action":"UPDATE","situation":"CONFIRMED"},{"action":"UPDATE","situation":"FOUND"},{"action":"CREATE","situation":"ABSENT"},{"action":"EXCEPTION","situation":"AMBIGUOUS"},{"action":"CREATE","situation":"MISSING"},{"action":"DELETE","situation":"SOURCE_MISSING"},{"action":"IGNORE","situation":"UNQUALIFIED"},{"action":"IGNORE","situation":"UNASSIGNED"}],"name":"systemLdapAccounts_managedUser"},{"target":"system/ldap/account","links":"systemLdapAccounts_managedUser","properties":[{"target":"givenName","source":"givenName"},{"target":"sn","source":"sn"},{"target":"cn","source":"","transform":{"type":"text/javascript","source":"source.displayName || (source.givenName + ' ' + source.sn);"}},{"target":"uid","source":"userName"},{"target":"description","source":"description","condition":{"type":"text/javascript","source":"!!object.description"}},{"target":"mail","source":"mail"},{"target":"userPassword","transform":{"type":"text/javascript","source":"openidm.decrypt(source);"},"source":"password","condition":{"type":"text/javascript","source":"object.password != null"}},{"target":"telephoneNumber","source":"telephoneNumber","condition":{"type":"text/javascript","source":"!!object.telephoneNumber"}}],"source":"managed/user","onCreate":{"type":"text/javascript","source":"target.dn = 'uid=' + source.userName + ',ou=People,dc=example,dc=com';"},"policies":[{"action":"UPDATE","situation":"CONFIRMED"},{"action":"LINK","situation":"FOUND"},{"action":"CREATE","situation":"ABSENT"},{"action":"IGNORE","situation":"AMBIGUOUS"},{"action":"IGNORE","situation":"MISSING"},{"action":"DELETE","situation":"SOURCE_MISSING"},{"action":"IGNORE","situation":"UNQUALIFIED"},{"action":"IGNORE","situation":"UNASSIGNED"}],"name":"managedUser_systemLdapAccounts"}],
mapping = {"target":"managed/user","properties":[{"target":"displayName","source":"cn"},{"target":"description","source":"description"},{"target":"givenName","source":"givenName"},{"target":"mail","source":"mail"},{"target":"telephoneNumber","source":"telephoneNumber"},{"target":"sn","source":"sn"},{"target":"userName","source":"uid"}],"source":"system/ldap/account","policies":[{"action":"UPDATE","situation":"CONFIRMED"},{"action":"UPDATE","situation":"FOUND"},{"action":"CREATE","situation":"ABSENT"},{"action":"EXCEPTION","situation":"AMBIGUOUS"},{"action":"CREATE","situation":"MISSING"},{"action":"DELETE","situation":"SOURCE_MISSING"},{"action":"IGNORE","situation":"UNQUALIFIED"},{"action":"IGNORE","situation":"UNASSIGNED"}],"name":"systemLdapAccounts_managedUser"},
QUnit.equal(SituationPolicyView.$el.children().length, 0, "There are no children in the container before render.");
QUnit.ok(SituationPolicyView.$el.children().length > 0, "After rendering there are now child elements");
_.each(SituationPolicyView.model.allPatterns["Default Actions"].policies, function(situation, index) {
if (situation.note !== SituationPolicyView.$el.find(".situationRow .info:eq("+index+")").attr("data-title")) {
messages = false;
if (SituationPolicyView.model.lookup.situations[situation.situation] !== SituationPolicyView.$el.find(".situationRow label:eq("+index+")").text()) {
order = false;
QUnit.equal(SituationPolicyView.$el.find(".situationRow .failure-display").length, 7, "There are 7 situations with error classes");
QUnit.equal(SituationPolicyView.$el.find(".situationRow .warning-display").length, 3, "There are 2 situations with warning classes");
QUnit.equal(SituationPolicyView.$el.find(".situationRow .success-display").length, 3, "There are 3 situations with success classes");
if ($(row).find(".action").val() !== "ASYNC" && index < SituationPolicyView.model.allPatterns["Read-only"].policies.length) {
readOnly = false
if ($(row).find(".action :selected").text().indexOf("★") < 0 && index < SituationPolicyView.model.allPatterns["Read-only"].policies.length) {
defaultActions = false
QUnit.ok(defaultActions, "When the pattern changes to Default-Actions all actions are set to the starred value");
mappingUpdated = false,
mappingUpdated = true;