From 5d919c9556345a8c230dbd3c43b52a0b9f066773 Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Tue, 4 Dec 2012 19:34:21 +0100 Subject: Change tests to use AMD loader Test were modified accordingly to AMD changes. https://fedorahosted.org/freeipa/ticket/112 --- install/ui/test/aci_tests.html | 27 ++++++--------- install/ui/test/aci_tests.js | 5 +-- install/ui/test/all_tests.html | 63 ++++++++++++++++++---------------- install/ui/test/association_tests.html | 21 ++++++------ install/ui/test/association_tests.js | 6 ++++ install/ui/test/certificate_tests.html | 21 ++++++------ install/ui/test/certificate_tests.js | 5 +++ install/ui/test/config.js | 43 +++++++++++++++++++++++ install/ui/test/details_tests.html | 22 ++++++------ install/ui/test/details_tests.js | 6 ++++ install/ui/test/entity_tests.html | 24 ++++++------- install/ui/test/entity_tests.js | 4 +++ install/ui/test/ip_tests.html | 10 ++++-- install/ui/test/ip_tests.js | 7 +++- install/ui/test/ipa_tests.html | 20 +++++------ install/ui/test/ipa_tests.js | 6 ++++ install/ui/test/jsl.conf | 3 +- install/ui/test/navigation_tests.html | 21 ++++++------ install/ui/test/navigation_tests.js | 5 +++ install/ui/test/ordered_map_tests.html | 13 +++++-- install/ui/test/ordered_map_tests.js | 5 +++ install/ui/test/utils_tests.html | 18 +++++----- install/ui/test/utils_tests.js | 7 +++- install/ui/test/widget_tests.html | 18 +++++----- install/ui/test/widget_tests.js | 12 +++---- 25 files changed, 243 insertions(+), 149 deletions(-) create mode 100644 install/ui/test/config.js (limited to 'install') diff --git a/install/ui/test/aci_tests.html b/install/ui/test/aci_tests.html index b57073039..996366ff7 100755 --- a/install/ui/test/aci_tests.html +++ b/install/ui/test/aci_tests.html @@ -4,23 +4,16 @@ Access Control Interface Test Suite - - - - - - - - - - - - - - - - - + + + + + + + +

ACI Test Suite

diff --git a/install/ui/test/aci_tests.js b/install/ui/test/aci_tests.js index 52fdc6037..fa1e971b1 100644 --- a/install/ui/test/aci_tests.js +++ b/install/ui/test/aci_tests.js @@ -18,6 +18,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +define(['freeipa/ipa', 'freeipa/jquery', 'freeipa/aci'], function(IPA, $) { + return function() { var target_container; var target_widget; @@ -286,5 +288,4 @@ test("Testing subtree target.", function() { same(get_visible_rows(target_widget), ['memberof', 'subtree', 'attrs_multi'], 'subtree row visible'); }); - - +};}); \ No newline at end of file diff --git a/install/ui/test/all_tests.html b/install/ui/test/all_tests.html index e9061b6ca..0acd8b76d 100644 --- a/install/ui/test/all_tests.html +++ b/install/ui/test/all_tests.html @@ -4,35 +4,40 @@ Complete Test Suite - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + +

Complete Test Suite

diff --git a/install/ui/test/association_tests.html b/install/ui/test/association_tests.html index 716efd31d..13fd53027 100644 --- a/install/ui/test/association_tests.html +++ b/install/ui/test/association_tests.html @@ -4,17 +4,16 @@ Association Test Suite - - - - - - - - - - - + + + + + + + +

Association Test Suite

diff --git a/install/ui/test/association_tests.js b/install/ui/test/association_tests.js index 547ca9f8b..40daacee8 100644 --- a/install/ui/test/association_tests.js +++ b/install/ui/test/association_tests.js @@ -18,6 +18,10 @@ * along with this program. If not, see . */ + +define(['freeipa/ipa', 'freeipa/jquery', 'freeipa/association', 'freeipa/entity'], function(IPA, $) { + return function() { + module('association'); @@ -135,3 +139,5 @@ test("Testing bulk_associator().", function() { IPA.command = orig_ipa_command; }); + +};}); \ No newline at end of file diff --git a/install/ui/test/certificate_tests.html b/install/ui/test/certificate_tests.html index dd8ccb6e3..23672862c 100755 --- a/install/ui/test/certificate_tests.html +++ b/install/ui/test/certificate_tests.html @@ -4,17 +4,16 @@ Certificate Test Suite - - - - - - - - - - - + + + + + + + +

Certificate Test Suite

diff --git a/install/ui/test/certificate_tests.js b/install/ui/test/certificate_tests.js index a3893d3d9..71e1c8deb 100755 --- a/install/ui/test/certificate_tests.js +++ b/install/ui/test/certificate_tests.js @@ -18,6 +18,9 @@ * along with this program. If not, see . */ +define(['freeipa/ipa', 'freeipa/jquery', 'freeipa/certificate'], function(IPA, $) { + return function() { + module('certificate'); test("Testing certificate_parse_dn().", function() { @@ -70,3 +73,5 @@ test("Testing certificate_parse_dn().", function() { }, "Checking IPA.cert.parse_dn('cn=John Smith,ou=Developers,ou=Users,dc=example,dc=com')"); }); + +};}); \ No newline at end of file diff --git a/install/ui/test/config.js b/install/ui/test/config.js new file mode 100644 index 000000000..620de8c8e --- /dev/null +++ b/install/ui/test/config.js @@ -0,0 +1,43 @@ +/* Authors: + * Petr Vobornik + * + * Copyright (C) 2012 Red Hat + * see file 'COPYING' for use and warranty information + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . +*/ + +var dojoConfig= { + baseUrl: "../js", + has: { + 'dojo-firebug': false, + 'dojo-debug-messages': true + }, + parseOnLoad: false, + async: true, + packages: [ + { + name:'dojo', + location:'dojo' + }, + { + name: 'freeipa', + location: 'freeipa' + }, + { + name: 'test', + location: '../test' + } + ] +}; \ No newline at end of file diff --git a/install/ui/test/details_tests.html b/install/ui/test/details_tests.html index d8232cd72..fb9fbc5bd 100644 --- a/install/ui/test/details_tests.html +++ b/install/ui/test/details_tests.html @@ -4,18 +4,16 @@ Details Test Suite - - - - - - - - - - - - + + + + + + + +

Details Test Suite

diff --git a/install/ui/test/details_tests.js b/install/ui/test/details_tests.js index 60c899e60..05308be60 100644 --- a/install/ui/test/details_tests.js +++ b/install/ui/test/details_tests.js @@ -18,6 +18,10 @@ * along with this program. If not, see . */ +define(['freeipa/ipa', 'freeipa/jquery', 'freeipa/details', + 'freeipa/entity'], function(IPA, $) { + return function() { + var details_container; @@ -352,3 +356,5 @@ test("Testing IPA.details_section_create again()",function() { 'Verifying field '+field.name+' was created'); } }); + +};}); \ No newline at end of file diff --git a/install/ui/test/entity_tests.html b/install/ui/test/entity_tests.html index 1b4918890..8d73d995e 100644 --- a/install/ui/test/entity_tests.html +++ b/install/ui/test/entity_tests.html @@ -4,20 +4,16 @@ Entity Test Suite - - - - - - - - - - - - - - + + + + + + + +

Entity Test Suite

diff --git a/install/ui/test/entity_tests.js b/install/ui/test/entity_tests.js index a81e0b892..f34060f79 100644 --- a/install/ui/test/entity_tests.js +++ b/install/ui/test/entity_tests.js @@ -19,6 +19,9 @@ * along with this program. If not, see . */ +define(['freeipa/ipa', 'freeipa/jquery', 'freeipa/entity', 'freeipa/search', + 'freeipa/details'], function(IPA, $) { + return function() { var entities_container; @@ -100,3 +103,4 @@ test('Testing IPA.entity_set_search_definition().', function() { }); +};}); diff --git a/install/ui/test/ip_tests.html b/install/ui/test/ip_tests.html index 76ba2a590..3f91bfdea 100644 --- a/install/ui/test/ip_tests.html +++ b/install/ui/test/ip_tests.html @@ -4,8 +4,14 @@ IP addresses test suite - - + + + + + +

IP addresses test suite

diff --git a/install/ui/test/ip_tests.js b/install/ui/test/ip_tests.js index 74fe7c2be..f7564e690 100644 --- a/install/ui/test/ip_tests.js +++ b/install/ui/test/ip_tests.js @@ -18,6 +18,9 @@ * along with this program. If not, see . */ +define(['freeipa/ipa', 'freeipa/net'], function(IPA, NET) { + return function() { + module('ip-addresses',{ setup: function() { }, @@ -300,4 +303,6 @@ test('Usage - set address.parts, no type', function() { address.parse(); ok(!address.valid, 'Still invalid'); same(address.type, null, 'Checking type'); -}); \ No newline at end of file +}); + +};}); \ No newline at end of file diff --git a/install/ui/test/ipa_tests.html b/install/ui/test/ipa_tests.html index 56f28b34d..31b208d0e 100644 --- a/install/ui/test/ipa_tests.html +++ b/install/ui/test/ipa_tests.html @@ -5,16 +5,16 @@ - - - - - - - - - - + + + + + + + +

Core Test Suite

diff --git a/install/ui/test/ipa_tests.js b/install/ui/test/ipa_tests.js index 478196caf..258abe7d6 100644 --- a/install/ui/test/ipa_tests.js +++ b/install/ui/test/ipa_tests.js @@ -18,6 +18,10 @@ * along with this program. If not, see . */ +define(['freeipa/ipa', 'freeipa/jquery', 'freeipa/dialog', 'freeipa/widget', + 'freeipa/details'], function(IPA, $) { + return function() { + module('ipa'); test("Testing ipa_init().", function() { @@ -304,3 +308,5 @@ test("Testing observer.", function() { obj.event.detach(func); obj.event.notify([param1_value, param2_value], obj); }); + +};}); \ No newline at end of file diff --git a/install/ui/test/jsl.conf b/install/ui/test/jsl.conf index 768a295f1..94ac10c50 100644 --- a/install/ui/test/jsl.conf +++ b/install/ui/test/jsl.conf @@ -126,9 +126,10 @@ +define strictEqual +define deepEqual +define equals -+define IPA +define expect ++define IPA +define NET ++define define ### Files diff --git a/install/ui/test/navigation_tests.html b/install/ui/test/navigation_tests.html index 9d7f1d0d9..d38182900 100644 --- a/install/ui/test/navigation_tests.html +++ b/install/ui/test/navigation_tests.html @@ -4,17 +4,16 @@ Navigation Test Suite - - - - - - - - - - - + + + + + + + +

Navigation Test Suite

diff --git a/install/ui/test/navigation_tests.js b/install/ui/test/navigation_tests.js index 2fb1e814a..309a0a634 100644 --- a/install/ui/test/navigation_tests.js +++ b/install/ui/test/navigation_tests.js @@ -18,6 +18,9 @@ * along with this program. If not, see . */ +define(['freeipa/ipa', 'freeipa/jquery', 'freeipa/navigation', 'freeipa/entity'], + function(IPA, $) { + return function() { module('navigation', { @@ -218,3 +221,5 @@ test("Testing IPA.navigation.update() with out-of-range index.", function() { entity_container.remove(); navigation_container.remove(); }); + +};}); \ No newline at end of file diff --git a/install/ui/test/ordered_map_tests.html b/install/ui/test/ordered_map_tests.html index 77f955c1f..3b019e6e0 100755 --- a/install/ui/test/ordered_map_tests.html +++ b/install/ui/test/ordered_map_tests.html @@ -5,9 +5,16 @@ - - - + + + + + + + +

Ordered Map Test Suite

diff --git a/install/ui/test/ordered_map_tests.js b/install/ui/test/ordered_map_tests.js index b708a1283..e8d8a7460 100755 --- a/install/ui/test/ordered_map_tests.js +++ b/install/ui/test/ordered_map_tests.js @@ -18,6 +18,9 @@ * along with this program. If not, see . */ +define(['freeipa/jquery'], function($) { + return function() { + module('ordered_map'); test("Testing $.ordered_map constructor.", function() { @@ -126,3 +129,5 @@ test("Testing $.ordered_map.empty().", function() { deepEqual(test.values, [], 'Checking values.'); deepEqual(test.map, {}, 'Checking map.'); }); + +};}); \ No newline at end of file diff --git a/install/ui/test/utils_tests.html b/install/ui/test/utils_tests.html index 5b81cc359..56616815e 100644 --- a/install/ui/test/utils_tests.html +++ b/install/ui/test/utils_tests.html @@ -3,15 +3,17 @@ IPA utils test suite - - - - - - - - + + + + + + + +

IPA utils test suite

diff --git a/install/ui/test/utils_tests.js b/install/ui/test/utils_tests.js index ff4fd2a3b..c93b89c39 100644 --- a/install/ui/test/utils_tests.js +++ b/install/ui/test/utils_tests.js @@ -18,6 +18,9 @@ * along with this program. If not, see . */ +define(['freeipa/ipa', 'freeipa/jquery', 'freeipa/field', 'freeipa/widget'], + function(IPA, $) { return function() { + var old; module('utils',{ @@ -133,4 +136,6 @@ test('Testing IPA.defined', function() { same(IPA.defined('', true), false, 'Empty string - checking'); same(IPA.defined(undefined), false, 'undefined'); same(IPA.defined(null), false, 'null'); -}); \ No newline at end of file +}); + +};}); \ No newline at end of file diff --git a/install/ui/test/widget_tests.html b/install/ui/test/widget_tests.html index 219608be1..50d156f51 100755 --- a/install/ui/test/widget_tests.html +++ b/install/ui/test/widget_tests.html @@ -4,14 +4,16 @@ Widget Test Suite - - - - - - - - + + + + + + + +

Widget Test Suite

diff --git a/install/ui/test/widget_tests.js b/install/ui/test/widget_tests.js index 7ed93608e..17ee15436 100644 --- a/install/ui/test/widget_tests.js +++ b/install/ui/test/widget_tests.js @@ -18,6 +18,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +define(['freeipa/ipa', 'freeipa/jquery', 'freeipa/field', 'freeipa/widget', + 'freeipa/entity'], + function(IPA, $) { return function() { var widget_container; var widget; @@ -350,11 +353,4 @@ test("IPA.radio_widget" ,function(){ }); - - - - - - - - +};}); \ No newline at end of file -- cgit