From f904df0f0dfd4734f978cdc3ddf5badabc067ed6 Mon Sep 17 00:00:00 2001 From: Adam Young Date: Wed, 19 Jan 2011 21:10:18 -0500 Subject: declarative defintions Delay the creation of entities until after ipa init is called made the user and group entity definitions declarative removed unused facet from groups adjusted unit tests made review changes: factories are now in an associative array entity init called right after factory init dialogs in entity init fixed type on search --- install/ui/test/entity_tests.js | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) (limited to 'install/ui/test/entity_tests.js') diff --git a/install/ui/test/entity_tests.js b/install/ui/test/entity_tests.js index 21fff48f..a5878a6c 100644 --- a/install/ui/test/entity_tests.js +++ b/install/ui/test/entity_tests.js @@ -18,7 +18,14 @@ * along with this program. If not, see . */ -module('entity'); +module('entity',{ + setup: function() { + IPA.register_entity(function(){return IPA.entity({name:'user'})}); + IPA.start_entities(); + }, + teardown: function() { + } +}); test('Testing IPA.entity_set_search_definition().', function() { @@ -79,19 +86,25 @@ test('Testing ipa_facet_setup_views().', function() { } ); - var entity = IPA.entity({ - 'name': 'user' - }); - IPA.add_entity(entity); + IPA.register_entity(function(){ + var entity = IPA.entity({ + 'name': 'user' + }); - var facet = IPA.search_facet({ - 'name': 'search', - 'label': 'Search' + return entity; }); - entity.add_facet(facet); - entity.create_association_facets(); + IPA.start_entities(); + + var entity = IPA.get_entity('user'); + var facet = IPA.search_facet({ + 'name': 'search', + 'label': 'Search' + }); + entity.add_facet(facet); + entity.create_association_facets(); + var container = $('
'); @@ -167,5 +180,3 @@ test('Testing ipa_facet_setup_views().', function() { IPA.switch_and_show_page = orig_switch_and_show_page; }); - - -- cgit