resourcetests.js revision 198a26b947e9f9c6a7cd6c8a9528f9a74d43bf3a
0N/A/**
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
0N/A *
0N/A * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
0N/A *
0N/A * The contents of this file are subject to the terms
0N/A * of the Common Development and Distribution License
0N/A * (the License). You may not use this file except in
0N/A * compliance with the License.
0N/A *
0N/A * You can obtain a copy of the License at
0N/A * http://forgerock.org/license/CDDLv1.0.html
0N/A * See the License for the specific language governing
0N/A * permission and limitations under the License.
0N/A *
0N/A * When distributing Covered Code, include this CDDL
0N/A * Header Notice in each file and include the License file
0N/A * at http://forgerock.org/license/CDDLv1.0.html
0N/A * If applicable, add the following below the CDDL Header,
0N/A * with the fields enclosed by brackets [] replaced by
0N/A * your own identifying information:
0N/A * "Portions Copyrighted [year] [name of copyright owner]"
0N/A */
0N/A
0N/A/*global require, define, QUnit, $ */
0N/A
0N/Adefine([
0N/A "../../../../target/test/libs/sinon-1.10.3.js",
0N/A "org/forgerock/commons/ui/common/util/Constants",
0N/A "org/forgerock/commons/ui/common/main/Router",
0N/A "org/forgerock/commons/ui/common/main/EventManager",
0N/A "org/forgerock/openidm/ui/admin/managed/AddEditManagedView",
0N/A "org/forgerock/openidm/ui/admin/ResourcesView",
0N/A "../mocks/adminInit",
0N/A "../mocks/resourceDetails"
0N/A], function (sinon, constants, router, eventManager, addEditManagedView, resourcesView, adminInit, resourceDetails) {
0N/A
0N/A return {
0N/A executeAll: function (server) {
0N/A
0N/A adminInit(server);
0N/A
0N/A module('Admin Resource UI Functions');
0N/A
0N/A QUnit.asyncTest("Resource View", function () {
0N/A
0N/A resourceDetails(server);
0N/A
0N/A resourcesView.render([], function () {
0N/A var viewManager = require("org/forgerock/commons/ui/common/main/ViewManager");
0N/A
0N/A QUnit.equal(resourcesView.$el.find("#resourceConnectorContainer .resource-body").length, 2, "Connectors and add Connector successfully added");
0N/A
0N/A QUnit.equal(resourcesView.$el.find("#resourceManagedContainer .resource-body").length, 5, "Managed Objects and add Managed Object successfully added");
0N/A
0N/A QUnit.start();
0N/A });
0N/A });
0N/A }
0N/A };
0N/A});