summaryrefslogtreecommitdiffstats
path: root/install/static/test
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2010-11-09 14:22:31 -0600
committerAdam Young <ayoung@redhat.com>2010-11-11 12:23:05 -0500
commit65c9442e2697f9e5d8b6cc2b7c22a6b8da426247 (patch)
treea998aa317a59102646fada66a4944d022ff2afa5 /install/static/test
parent569f4e1a5cb3ff4cf3a7bf3c2aa5fdfa9ced0134 (diff)
downloadfreeipa.git-65c9442e2697f9e5d8b6cc2b7c22a6b8da426247.tar.gz
freeipa.git-65c9442e2697f9e5d8b6cc2b7c22a6b8da426247.tar.xz
freeipa.git-65c9442e2697f9e5d8b6cc2b7c22a6b8da426247.zip
HBAC Services
The HBAC Service search and details pages have been added under the HBAC tab. This requires some changes to the framework. Currently the navigation framework doesn't support multiple entities under one tab. As a temporary solution, an 'entity' URL parameter is used to determine the entity to be displayed. This parameter is now only used by HBAC tab, but its use might be expanded later. The navigation framework needs be redesigned to provide more flexibility. The search page in all entities except DNS records have been changed to use the ipa_search_widget. The Select/Unselect All checbox and Delete button now work correctly and consistently. The Add dialog has been enhanced to render and work in a more consistent way while still supporting custom widgets & layouts. For the search page, the Add button will refresh the search results and clear the fields in the dialog box. The framework now provides some extension points which can be overriden by the subclasses: - init(): for initialization and configuration - create(): for creating the layout dynamically or from template - setup(): for setting the look and feel - load(): for loading the data Entity and facet initialization is now done after IPA.init(). This is to ensure the metadata is loaded first so the entities and facets can use localized messages/labels/titles. The group entity has been partially converted to use the new framework. The unit tests have been updated accordingly.
Diffstat (limited to 'install/static/test')
-rw-r--r--install/static/test/details_tests.js22
-rw-r--r--install/static/test/entity_tests.js12
-rw-r--r--install/static/test/ipa_tests.html1
3 files changed, 21 insertions, 14 deletions
diff --git a/install/static/test/details_tests.js b/install/static/test/details_tests.js
index 1dd0ddf1..80dbc398 100644
--- a/install/static/test/details_tests.js
+++ b/install/static/test/details_tests.js
@@ -19,7 +19,7 @@
*/
-test("Testing ipa_details_section.setup().", function() {
+test("Testing ipa_details_section.create().", function() {
IPA.ajax_options.async = false;
@@ -34,8 +34,6 @@ test("Testing ipa_details_section.setup().", function() {
}
);
- var result = {};
-
var section = ipa_details_section({name:'IDIDID', label:'NAMENAMENAME'}).
input({name:'cn', label:'Entity Name'}).
input({name:'description', label:'Description'}).
@@ -44,7 +42,7 @@ test("Testing ipa_details_section.setup().", function() {
var fields = section.fields;
var container = $("<div/>");
- section.setup(container, result);
+ section.create(container);
var dl = container.find('dl');
@@ -80,7 +78,7 @@ test("Testing ipa_details_section.setup().", function() {
-test("Testing details lifecycle: create, save ().", function(){
+test("Testing details lifecycle: create, setup, load.", function(){
IPA.ajax_options.async = false;
@@ -168,7 +166,9 @@ test("Testing details lifecycle: create, save ().", function(){
var entity = ipa_get_entity(obj_name);
var facet = entity.get_facet('details');
- facet.create(container, result);
+ facet.create(container);
+ facet.setup(container);
+ facet.load(container, result);
var contact = container.find('dl#contact.entryattrs');
@@ -192,7 +192,7 @@ test("Testing details lifecycle: create, save ().", function(){
);
same(
- dts[5].title, facet.get_sections()[0].get_fields()[5].name,
+ dts[5].title, facet.sections[0].fields[5].name,
'Checking dt title'
);
@@ -205,7 +205,7 @@ test("Testing details lifecycle: create, save ().", function(){
ok (load_manager_called, 'load manager called');
- ipa_details_update(container,
+ facet.update(container,
'kfrog',
function(){update_success_called = true},
function(){update_failure_called = true});
@@ -265,7 +265,11 @@ test("Testing ipa_details_section_setup again()",function(){
var details = $("<div/>");
container.append(details);
- section.setup(container, details, section);
+ var result = {};
+
+ section.create(container);
+ section.setup(container);
+ section.load(container, result);
ok(container.find('hr'),'hr');
diff --git a/install/static/test/entity_tests.js b/install/static/test/entity_tests.js
index 08fc3111..5d98d7b1 100644
--- a/install/static/test/entity_tests.js
+++ b/install/static/test/entity_tests.js
@@ -61,7 +61,7 @@ test('Testing ipa_entity_set_search_definition().', function() {
);
});
-test('Testing ipa_entity_generate_views().', function() {
+test('Testing ipa_facet_setup_views().', function() {
var orig_show_page = IPA.show_page;
IPA.ajax_options.async = false;
@@ -83,9 +83,10 @@ test('Testing ipa_entity_generate_views().', function() {
IPA.add_entity(entity);
- var facet = entity.create_association_facet({
+ var facet = ipa_association_facet({
'name': 'associate'
});
+ entity.add_facet(facet);
var container = $('<div/>');
@@ -179,11 +180,12 @@ test('Testing ipa_entity_quick_links().', function() {
var tbody = $('<tbody/>').appendTo(search_table);
var tr = $('<tr/>').appendTo(tbody);
+ var td = $('<td/>').appendTo(tr);
+ var span = $('<span/>', {name:'quick_links'}).appendTo(td);
- ipa_entity_quick_links(tr, null, null, entry_attrs);
+ ipa_entity_quick_links(tr, 'quick_links', null, entry_attrs);
- var td = tr.children().first();
- var link = td.children().first();
+ var link = span.children().first();
equals(
link.attr('href'), '#details',
diff --git a/install/static/test/ipa_tests.html b/install/static/test/ipa_tests.html
index 3f3c1686..903e7154 100644
--- a/install/static/test/ipa_tests.html
+++ b/install/static/test/ipa_tests.html
@@ -7,6 +7,7 @@
<script type="text/javascript" src="qunit.js"></script>
<script type="text/javascript" src="../jquery.js"></script>
+ <script type="text/javascript" src="../jquery.ba-bbq.js"></script>
<script type="text/javascript" src="../jquery-ui.js"></script>
<script type="text/javascript" src="../ipa.js"></script>
<script type="text/javascript" src="ipa_tests.js"></script>