specific.js revision c54f5c9f018cfaf6792ae351d3f0be15efdd175e
308N/A/**
2362N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
308N/A *
308N/A * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
308N/A *
308N/A * The contents of this file are subject to the terms
2362N/A * of the Common Development and Distribution License
308N/A * (the License). You may not use this file except in
2362N/A * compliance with the License.
308N/A *
308N/A * You can obtain a copy of the License at
308N/A * http://forgerock.org/license/CDDLv1.0.html
308N/A * See the License for the specific language governing
308N/A * permission and limitations under the License.
308N/A *
308N/A * When distributing Covered Code, include this CDDL
308N/A * Header Notice in each file and include the License file
308N/A * at http://forgerock.org/license/CDDLv1.0.html
308N/A * If applicable, add the following below the CDDL Header,
308N/A * with the fields enclosed by brackets [] replaced by
2362N/A * your own identifying information:
2362N/A * "Portions Copyrighted [year] [name of copyright owner]"
2362N/A */
308N/A
308N/A/*global require, define, module, $, QUnit, window*/
308N/Adefine([
308N/A "sinon",
308N/A "org/forgerock/commons/ui/common/main/Configuration",
430N/A "org/forgerock/openidm/ui/user/LoginView",
308N/A "org/forgerock/openidm/ui/user/delegates/SiteIdentificationDelegate",
308N/A "./mocks/siteIdentification"
430N/A], function (sinon, conf, LoginView, siteIdentificationDelegate, siteIdentificationMocks) {
430N/A
308N/A return {
308N/A executeAll: function (server) {
308N/A
308N/A module("EndUser UI Functions");
308N/A
308N/A QUnit.asyncTest("Site Identification for login screen", function () {
308N/A
308N/A siteIdentificationMocks(server);
308N/A conf.globalData.siteIdentification = true;
308N/A
308N/A LoginView.render([], function () {
308N/A
308N/A var siteIdStub = sinon.stub(siteIdentificationDelegate, "getSiteIdentificationForLogin", function (login, callback) {
308N/A siteIdentificationDelegate.getSiteIdentificationForLogin.restore();
308N/A siteIdentificationDelegate.getSiteIdentificationForLogin(login, function (data) {
308N/A
308N/A callback(data);
308N/A
308N/A QUnit.equal($("#siteImage").css('display'), "block", "Site Image displayed");
308N/A QUnit.equal($("#passPhrase").text(), "human", "Site ID Phrase displayed");
308N/A
308N/A QUnit.start();
430N/A
430N/A });
430N/A
308N/A
308N/A });
430N/A
308N/A QUnit.ok($('#identificationMessage').length, "Site Identification Prompt displayed");
308N/A
308N/A $("[name=login]").val("openidm-admin").trigger("change");
308N/A
});
});
}
};
});