summaryrefslogtreecommitdiffstats
path: root/install/static/test/details_tests.js
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2010-11-15 11:10:55 -0600
committerEndi Sukma Dewata <edewata@redhat.com>2010-11-15 12:48:45 -0500
commit9c502641b5f7bf613eb9dbd4be21fbaf92312267 (patch)
tree9421ac0faa0dd3bbd2dac71c6b0a4a94ec3fd6b1 /install/static/test/details_tests.js
parent629e9520e0b5ce1ae6138d4e2c69ac52927c044a (diff)
downloadfreeipa-9c502641b5f7bf613eb9dbd4be21fbaf92312267.tar.gz
freeipa-9c502641b5f7bf613eb9dbd4be21fbaf92312267.tar.xz
freeipa-9c502641b5f7bf613eb9dbd4be21fbaf92312267.zip
HBAC details page enhancement
The HBAC details page has been enhanced to support Undo and Reset operations. The functionality is implemented in the base widget class so the behavior will be more consistent across widgets. A <span> tag now used to define the field boundary in the HTML doc. The tag contains the visual representation of the field which include the input tag and optionally the undo link. The Update method on HBAC details page has been modified so that it executes several operations using a batch command. The operations being executed depends on the changes made to the fields. These operations may include: - removing access time if access time is changed to any time - removing memberships if member category is changed to all - modifying rule attributes if description or rule type is changed - enabling/disabling the rule if rule status is changed The behavior of the Add & Remove buttons also has been changed such that it adjust the category attribute properly in addition to adding the memberships using batch command. For example, if category is initially set to all, adding a new member will also change the category to empty. The ipa_command have been modified to store the on_success and on_error handlers as properties. When the command is executed as a part of batch operation, the result of each command will be passed to the appropriate handler. The unit tests and test data have been updated as well.
Diffstat (limited to 'install/static/test/details_tests.js')
-rw-r--r--install/static/test/details_tests.js43
1 files changed, 31 insertions, 12 deletions
diff --git a/install/static/test/details_tests.js b/install/static/test/details_tests.js
index 80dbc3986..2bb9b9c66 100644
--- a/install/static/test/details_tests.js
+++ b/install/static/test/details_tests.js
@@ -34,7 +34,7 @@ test("Testing ipa_details_section.create().", function() {
}
);
- var section = ipa_details_section({name:'IDIDID', label:'NAMENAMENAME'}).
+ 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'});
@@ -168,7 +168,7 @@ test("Testing details lifecycle: create, setup, load.", function(){
var facet = entity.get_facet('details');
facet.create(container);
facet.setup(container);
- facet.load(container, result);
+ facet.display(result);
var contact = container.find('dl#contact.entryattrs');
@@ -256,7 +256,7 @@ test("Testing _ipa_create_text_input() read only .", function(){
test("Testing ipa_details_section_setup again()",function(){
- var section = ipa_details_section({name: 'IDIDID', label: 'NAMENAMENAME'}).
+ 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'});
@@ -269,7 +269,7 @@ test("Testing ipa_details_section_setup again()",function(){
section.create(container);
section.setup(container);
- section.load(container, result);
+ section.load(result);
ok(container.find('hr'),'hr');
@@ -278,14 +278,33 @@ test("Testing ipa_details_section_setup again()",function(){
//ok(h2[0].innerHTML.indexOf(section.label) > 1,"find name in html");
var dl = container.find('dl');
- ok(dl,'dl');
- same(dl[0].children.length,6,'6 children');
- same(dl[0].id, section.name);
- same(dl[0].children[0].title, fields[0].name,'title matches name');
- same(dl[0].children[0].innerHTML, fields[0].label+":",
- 'inner HTML matches label');
- same(dl[0].children[5].title, fields[2].name,
- 'title matches fields[2] name');
+ ok(
+ dl.length,
+ 'dl is created'
+ );
+
+ same(
+ dl[0].children.length, 3,
+ '3 spans'
+ );
+
+ same(
+ dl[0].id, section.name,
+ 'checking section name'
+ );
+ same(
+ dl[0].children[0].children[0].title, fields[0].name,
+ 'title matches name'
+ );
+
+ same(
+ dl[0].children[0].children[0].innerHTML, fields[0].label+":",
+ 'inner HTML matches label'
+ );
+ same(
+ dl[0].children[2].children[0].title, fields[2].name,
+ 'title matches fields[2] name'
+ );
});