editConnectorTest.js revision 67c044a145fa1987d77d3f609876a839b0240ed0
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2015 ForgeRock AS. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*/
/*global require, define, QUnit, $ */
define([
"../mocks/connectorAddEdit",
return {
executeAll: function (server) {
module('Admin Edit Connector UI Functions');
//Base connector tests
QUnit.ok(editConnector.$el.find(".page-header .media .media-body .page-type").html() === "LDAP Connector - 1.4.0.0", "Connector type set");
QUnit.ok(editConnector.$el.find(".page-header .media .media-body h1").html() === "ldap", "Connector name set");
QUnit.equal(editConnector.$el.find(".nav-tabs li").length, 4, "Tabs detected and tabdrop prepared");
QUnit.ok(editConnector.$el.find("#connectorEnabled").val() === "true", "Connector defaults to enabled");
QUnit.equal(editConnector.$el.find(".message .connector-pending").length, 1, "Connector change message displayed");
//Object type tests
QUnit.equal(editConnector.$el.find("#selectObjectConfig").length, 1, "Prdefined object type dropdown displayed");
QUnit.equal(editConnector.$el.find("#objectTypesTab table tbody tr").length, 2, "Object type table populated");
//Sync tests
QUnit.equal(editConnector.$el.find("#syncTab .sources option").length, 2, "Sync schedule sources loaded");
QUnit.equal(editConnector.$el.find("#syncTab .liveSyncScheduleContainer").length, 1, "Sync schedule added");
QUnit.equal(editConnector.$el.find("#syncTab #retryOptions option").length, 3, "LiveSync options loaded");
QUnit.ok(editConnector.$el.find("#syncTab .postActionBlock").not(":visible"), "Retry options changed");
QUnit.equal(editConnector.$el.find(".message .sync-pending").length, 1, "Sync change message displayed");
//More Object type tests
editConnector.$el.find("#objectTypesTab table tbody tr").first().find(".delete-objectType").click();
QUnit.equal(editConnector.$el.find("#objectTypesTab table tbody tr").length, 1, "Delete successful");
QUnit.equal(editConnector.$el.find(".message .objecttype-pending").length, 1, "Object type change message displayed");
});
});
}
};
});