summaryrefslogtreecommitdiffstats
path: root/install/ui/test
diff options
context:
space:
mode:
authorMartin Kosek <mkosek@redhat.com>2011-02-16 14:26:35 +0100
committerAdam Young <ayoung@redhat.com>2011-02-18 09:49:37 -0500
commitb7700ea815222b4de80741ad77b31707051300bd (patch)
tree4c92ba518468af34f9587131c8f4de3bb13613e3 /install/ui/test
parent27532f54687297e5dfa7d66503f22186d7fc3237 (diff)
downloadfreeipa-b7700ea815222b4de80741ad77b31707051300bd.tar.gz
freeipa-b7700ea815222b4de80741ad77b31707051300bd.tar.xz
freeipa-b7700ea815222b4de80741ad77b31707051300bd.zip
Remove WebUI identifiers from global namespace
Many WebUI identifiers were defined in a global namespace. This is not a good programming practice and may result in name clashes, for example with other libraries. This patch moves these variables to IPA namespace or its sub-namespaces, when meaningful. https://fedorahosted.org/freeipa/ticket/212
Diffstat (limited to 'install/ui/test')
-rwxr-xr-xinstall/ui/test/certificate_tests.js36
-rw-r--r--install/ui/test/navigation_tests.js60
2 files changed, 48 insertions, 48 deletions
diff --git a/install/ui/test/certificate_tests.js b/install/ui/test/certificate_tests.js
index c50ec1867..56bd40938 100755
--- a/install/ui/test/certificate_tests.js
+++ b/install/ui/test/certificate_tests.js
@@ -23,42 +23,42 @@ module('certificate');
test("Testing certificate_parse_dn().", function() {
same(
- certificate_parse_dn(), {},
- "Checking certificate_parse_dn()"
+ IPA.cert.parse_dn(), {},
+ "Checking IPA.cert.parse_dn()"
);
same(
- certificate_parse_dn(''), {},
- "Checking certificate_parse_dn('')"
+ IPA.cert.parse_dn(''), {},
+ "Checking IPA.cert.parse_dn('')"
);
same(
- certificate_parse_dn('c=US'), {'c': 'US'},
- "Checking certificate_parse_dn('c=US')"
+ IPA.cert.parse_dn('c=US'), {'c': 'US'},
+ "Checking IPA.cert.parse_dn('c=US')"
);
same(
- certificate_parse_dn('st=TX,c=US'), {'st': 'TX','c': 'US'},
- "Checking certificate_parse_dn('st=TX,c=US')"
+ IPA.cert.parse_dn('st=TX,c=US'), {'st': 'TX','c': 'US'},
+ "Checking IPA.cert.parse_dn('st=TX,c=US')"
);
same(
- certificate_parse_dn('c=US,st=TX'), {'st': 'TX','c': 'US'},
- "Checking certificate_parse_dn('c=US,st=TX')"
+ IPA.cert.parse_dn('c=US,st=TX'), {'st': 'TX','c': 'US'},
+ "Checking IPA.cert.parse_dn('c=US,st=TX')"
);
same(
- certificate_parse_dn(' st = New Mexico , c = US '), {'st': 'New Mexico','c': 'US'},
- "Checking certificate_parse_dn(' st = New Mexico , c = US ')"
+ IPA.cert.parse_dn(' st = New Mexico , c = US '), {'st': 'New Mexico','c': 'US'},
+ "Checking IPA.cert.parse_dn(' st = New Mexico , c = US ')"
);
same(
- certificate_parse_dn('ST=TX,C=US'), {'st': 'TX','c': 'US'},
- "Checking certificate_parse_dn('ST=TX,C=US')"
+ IPA.cert.parse_dn('ST=TX,C=US'), {'st': 'TX','c': 'US'},
+ "Checking IPA.cert.parse_dn('ST=TX,C=US')"
);
same(
- certificate_parse_dn('cn=dev.example.com,ou=Engineering,o=Example,l=Austin,ST=TX,C=US'),
+ IPA.cert.parse_dn('cn=dev.example.com,ou=Engineering,o=Example,l=Austin,ST=TX,C=US'),
{ 'cn': 'dev.example.com',
'ou': 'Engineering',
'o': 'Example',
@@ -66,16 +66,16 @@ test("Testing certificate_parse_dn().", function() {
'st': 'TX',
'c': 'US'
},
- "Checking certificate_parse_dn('cn=dev.example.com,ou=Engineering,o=Example,l=Austin,ST=TX,C=US')"
+ "Checking IPA.cert.parse_dn('cn=dev.example.com,ou=Engineering,o=Example,l=Austin,ST=TX,C=US')"
);
same(
- certificate_parse_dn('cn=John Smith,ou=Developers,ou=Users,dc=example,dc=com'),
+ IPA.cert.parse_dn('cn=John Smith,ou=Developers,ou=Users,dc=example,dc=com'),
{
'cn': 'John Smith',
'ou': ['Developers','Users'],
'dc': ['example', 'com']
},
- "Checking certificate_parse_dn('cn=John Smith,ou=Developers,ou=Users,dc=example,dc=com')"
+ "Checking IPA.cert.parse_dn('cn=John Smith,ou=Developers,ou=Users,dc=example,dc=com')"
);
});
diff --git a/install/ui/test/navigation_tests.js b/install/ui/test/navigation_tests.js
index 9db0bb1cc..29b1cfab9 100644
--- a/install/ui/test/navigation_tests.js
+++ b/install/ui/test/navigation_tests.js
@@ -21,7 +21,7 @@
module('navigation');
-test("Testing nav_create().", function() {
+test("Testing IPA.nav.create().", function() {
var mock_tabs_lists = [
{ name:'identity', label:'IDENTITY', children: [
@@ -56,7 +56,7 @@ test("Testing nav_create().", function() {
var navigation = $('<div id="navigation"/>').appendTo(document.body);
var user_mock_called = false;
var group_mock_called = false;
- nav_create(mock_tabs_lists, navigation, 'tabs');
+ IPA.nav.create(mock_tabs_lists, navigation, 'tabs');
ok(user_mock_called, "mock user setup was called");
ok(!group_mock_called, "mock group setup was not called because the tab is inactive");
same( navigation[0].children.length, 2, "Two Child tabs");
@@ -66,21 +66,21 @@ test("Testing nav_create().", function() {
navigation.remove();
});
-test("Testing nav_update_tabs() with valid index.", function() {
+test("Testing IPA.nav.update_tabs() with valid index.", function() {
- var orig_push_state = nav_push_state;
- var orig_get_state = nav_get_state;
- var orig_remove_state = nav_remove_state;
+ var orig_push_state = IPA.nav.push_state;
+ var orig_get_state = IPA.nav.get_state;
+ var orig_remove_state = IPA.nav.remove_state;
var state = {};
- nav_push_state = function(params) {
+ IPA.nav.push_state = function(params) {
$.extend(state, params);
};
- nav_get_state = function(key) {
+ IPA.nav.get_state = function(key) {
return state[key];
};
- nav_remove_state = function(key) {
+ IPA.nav.remove_state = function(key) {
delete state[key];
};
@@ -93,10 +93,10 @@ test("Testing nav_update_tabs() with valid index.", function() {
var navigation = $('<div id="navigation"/>').appendTo(document.body);
- nav_create(mock_tabs_lists, navigation, 'tabs');
+ IPA.nav.create(mock_tabs_lists, navigation, 'tabs');
- nav_push_state({"identity":1});
- nav_update_tabs();
+ IPA.nav.push_state({"identity":1});
+ IPA.nav.update_tabs();
same(
navigation.tabs('option', 'selected'), 0,
@@ -108,30 +108,30 @@ test("Testing nav_update_tabs() with valid index.", function() {
"Active tab at level 2"
);
- nav_remove_state("identity");
+ IPA.nav.remove_state("identity");
navigation.remove();
- nav_push_state = orig_push_state;
- nav_get_state = orig_get_state;
- nav_remove_state = orig_remove_state;
+ IPA.nav.push_state = orig_push_state;
+ IPA.nav.get_state = orig_get_state;
+ IPA.nav.remove_state = orig_remove_state;
});
-test("Testing nav_update_tabs() with out-of-range index.", function() {
+test("Testing IPA.nav.update_tabs() with out-of-range index.", function() {
- var orig_push_state = nav_push_state;
- var orig_get_state = nav_get_state;
- var orig_remove_state = nav_remove_state;
+ var orig_push_state = IPA.nav.push_state;
+ var orig_get_state = IPA.nav.get_state;
+ var orig_remove_state = IPA.nav.remove_state;
var state = {};
- nav_push_state = function(params) {
+ IPA.nav.push_state = function(params) {
$.extend(state, params);
};
- nav_get_state = function(key) {
+ IPA.nav.get_state = function(key) {
return state[key];
};
- nav_remove_state = function(key) {
+ IPA.nav.remove_state = function(key) {
delete state[key];
};
@@ -144,10 +144,10 @@ test("Testing nav_update_tabs() with out-of-range index.", function() {
var navigation = $('<div id="navigation"/>').appendTo(document.body);
- nav_create(mock_tabs_lists, navigation, 'tabs');
+ IPA.nav.create(mock_tabs_lists, navigation, 'tabs');
- nav_push_state({"identity":2});
- nav_update_tabs();
+ IPA.nav.push_state({"identity":2});
+ IPA.nav.update_tabs();
same(
navigation.tabs('option', 'selected'), 0,
@@ -159,11 +159,11 @@ test("Testing nav_update_tabs() with out-of-range index.", function() {
"Active tab at level 2"
);
- nav_remove_state("identity");
+ IPA.nav.remove_state("identity");
navigation.remove();
- nav_push_state = orig_push_state;
- nav_get_state = orig_get_state;
- nav_remove_state = orig_remove_state;
+ IPA.nav.push_state = orig_push_state;
+ IPA.nav.get_state = orig_get_state;
+ IPA.nav.remove_state = orig_remove_state;
});