summaryrefslogtreecommitdiffstats
path: root/install/static/test/navigation_tests.js
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/navigation_tests.js
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/navigation_tests.js')
-rw-r--r--install/static/test/navigation_tests.js26
1 files changed, 16 insertions, 10 deletions
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;