From a8ea42bda841c8773d68886614faf9efd38e33bd Mon Sep 17 00:00:00 2001 From: Endi Sukma Dewata Date: Wed, 16 Nov 2011 21:07:20 -0600 Subject: Fixed entity metadata resolution. The current code assumes that an entity will always have a corresponding LDAPObject on the server, so it looks for the metadata in a fixed location. This assumption doesn't work for HBAC Test since it is a Command, not an LDAPObject, so the metadata has to be obtained from a different location. A new method get_default_metadata() has been added to allow each entity to find the metadata from the correct location. Ticket #388 --- install/ui/test/navigation_tests.js | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'install/ui/test/navigation_tests.js') diff --git a/install/ui/test/navigation_tests.js b/install/ui/test/navigation_tests.js index f55e2967..2fb1e814 100644 --- a/install/ui/test/navigation_tests.js +++ b/install/ui/test/navigation_tests.js @@ -41,10 +41,11 @@ test("Testing IPA.navigation.create().", function() { //Force reset of entities IPA.entities = $.ordered_map(); - IPA.entity_factories.user = function() { + IPA.register('user', function(spec) { + var that = IPA.entity({ name: 'user', - metadata:IPA.metadata.objects.user, + metadata: IPA.metadata.objects.user, facets: [ { type: 'search' @@ -57,18 +58,25 @@ test("Testing IPA.navigation.create().", function() { same(container.attr('name'), 'user', 'user container name'); same(container[0].nodeName, 'DIV', 'user container element'); }; + return that; - }; - IPA.entity_factories.group = function(){ - var that = IPA.entity({name: 'group', - metadata:IPA.metadata.objects.group}); + }); + + IPA.register('group', function(spec) { + + var that = IPA.entity({ + name: 'group', + metadata: IPA.metadata.objects.group + }); + that.display = function(container){ group_mock_called = true; same(container.attr('name'), 'group','user container name'); same(container[0].nodeName, 'DIV', 'user container element'); }; + return that; - }; + }); var navigation_container = $('