summaryrefslogtreecommitdiffstats
path: root/install/static/test
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2010-12-07 12:17:12 -0600
committerAdam Young <ayoung@redhat.com>2010-12-07 17:54:04 -0500
commitdeb94b150dc48d3af2a461e7d325f7c68cceefef (patch)
treec63fbb43db12a3c3b0de65e482af17ef17622bc6 /install/static/test
parent9e5fdcb3a4af41282e72d314b65341d9aa209e23 (diff)
downloadfreeipa-deb94b150dc48d3af2a461e7d325f7c68cceefef.tar.gz
freeipa-deb94b150dc48d3af2a461e7d325f7c68cceefef.tar.xz
freeipa-deb94b150dc48d3af2a461e7d325f7c68cceefef.zip
Navigation updates
The entity.default_facet has been removed, instead the first facet registered to the entity will be considered as the default facet. So, the 'setup' parameter has been removed from tab definitions because it's no longer necessary. The ipa_details_only_setup() has been removed as well. An 'entity' parameter has been added to tab definitions to specify which entity corresponds to a tab item. The tab label has been changed to use entity label if available. Some hard-coded labels have been removed. The unit tests have been updated.
Diffstat (limited to 'install/static/test')
-rw-r--r--install/static/test/details_tests.js50
-rw-r--r--install/static/test/navigation_tests.js26
2 files changed, 41 insertions, 35 deletions
diff --git a/install/static/test/details_tests.js b/install/static/test/details_tests.js
index baa884e2..3dee5357 100644
--- a/install/static/test/details_tests.js
+++ b/install/static/test/details_tests.js
@@ -35,9 +35,9 @@ test("Testing ipa_details_section.create().", function() {
);
var section = ipa_details_list_section({name:'IDIDID', label:'NAMENAMENAME'}).
- input({name:'cn', label:'Entity Name'}).
- input({name:'description', label:'Description'}).
- input({name:'number', label:'Entity ID'});
+ input({name:'cn'}).
+ input({name:'description'}).
+ input({name:'number'});
var fields = section.fields;
@@ -147,32 +147,32 @@ test("Testing details lifecycle: create, setup, load.", function(){
var obj_name = 'user';
ipa_entity_set_details_definition(obj_name, [
ipa_stanza({name:'identity', label:'Identity Details'}).
- input({name:'title', label: 'Title'}).
- input({name:'givenname', label:'First Name'}).
- input({name:'sn', label:'Last Name'}).
- input({name:'cn', label:'Full Name'}).
- input({name:'displayname', label:'Dispaly Name'}).
- input({name:'initials', label:'Initials'}),
+ input({name:'title'}).
+ input({name:'givenname'}).
+ input({name:'sn'}).
+ input({name:'cn'}).
+ input({name:'displayname'}).
+ input({name:'initials'}),
ipa_stanza({name:'account', label:'Account Details'}).
- input({name:'status', label:'Account Status', setup: setup_status}).
- input({name:'uid', label:'Login'}).
- input({name:'userpassword', label:'Password', save: save_password}).
- input({name:'uidnumber', label:'UID'}).
- input({name:'gidnumber', label:'GID'}).
- input({name:'homedirectory', label:'homedirectory'}),
+ input({name:'status', setup: setup_status}).
+ input({name:'uid'}).
+ input({name:'userpassword', save: save_password}).
+ input({name:'uidnumber'}).
+ input({name:'gidnumber'}).
+ input({name:'homedirectory'}),
ipa_stanza({name:'contact', label:'Contact Details'}).
- input({name:'mail', label:'E-mail Address'}).
- input({name:'telephonenumber', label:'Numbers'}),
- ipa_stanza({name:'address', label:'Mailing Address'}).
- input({name:'street', label:'Address'}).
- input({name:'location', label:'City'}).
- input({name:'state', label:'State', setup: setup_st}).
- input({name:'postalcode', label:'ZIP'}),
+ input({name:'mail'}).
+ input({name:'telephonenumber'}),
+ ipa_stanza({name:'address'}).
+ input({name:'street'}).
+ input({name:'location'}).
+ input({name:'state', setup: setup_st}).
+ input({name:'postalcode'}),
ipa_stanza({name:'employee', label:'Employee Information'}).
- input({name:'ou', label:'Org. Unit'}).
- input({name:'manager', label:'Manager', load: load_manager}),
+ input({name:'ou'}).
+ input({name:'manager', load: load_manager}),
ipa_stanza({name:'misc', label:'Misc. Information'}).
- input({name:'carlicense', label:'Car License'})
+ input({name:'carlicense'})
]);
var entity = ipa_get_entity(obj_name);
diff --git a/install/static/test/navigation_tests.js b/install/static/test/navigation_tests.js
index 68d4694f..0d6f322d 100644
--- a/install/static/test/navigation_tests.js
+++ b/install/static/test/navigation_tests.js
@@ -26,20 +26,26 @@ test("Testing nav_create().", function() {
var mock_tabs_lists =
[
{ name:'identity', label:'IDENTITY', children: [
- {name:'user', label:'Users', setup:mock_setup_user},
- {name:'group', label:'Users', setup:mock_setup_group}
+ {name:'user', entity:'user'},
+ {name:'group', entity:'group'}
]}];
- function mock_setup_user (jobj){
+
+ var entity = ipa_entity({name: 'user'});
+ entity.setup = function(container){
user_mock_called = true;
- same(jobj[0].id,'user','user id');
- same(jobj[0].nodeName,'DIV','user div');
- }
- function mock_setup_group (jobj){
+ same(container[0].id,'user','user id');
+ same(container[0].nodeName,'DIV','user div');
+ };
+ IPA.add_entity(entity);
+
+ entity = ipa_entity({name: 'group'});
+ entity.setup = function(container){
group_mock_called = true;
- same(jobj[0].id,'group','group id');
- same(jobj[0].nodeName,'DIV','group Div');
+ same(container[0].id,'group','group id');
+ same(container[0].nodeName,'DIV','group Div');
+ };
+ IPA.add_entity(entity);
- }
IPA.metadata = {};
var navigation = $('<div id="navigation"/>').appendTo(document.body);
var user_mock_called = false;