diff options
Diffstat (limited to 'install/static/test')
-rw-r--r-- | install/static/test/data/hbac_mod.json | 66 | ||||
-rw-r--r-- | install/static/test/data/hbac_show.json | 31 | ||||
-rw-r--r-- | install/static/test/details_tests.js | 43 |
3 files changed, 116 insertions, 24 deletions
diff --git a/install/static/test/data/hbac_mod.json b/install/static/test/data/hbac_mod.json index ea090040a..ea2b4d1e8 100644 --- a/install/static/test/data/hbac_mod.json +++ b/install/static/test/data/hbac_mod.json @@ -1,12 +1,60 @@ { - "error": { - "code": 4202, - "kw": {}, - "message": "no modifications to be performed", - "name": { - "__base64__": "RW1wdHlNb2RsaXN0" - } - }, + "error": null, "id": 0, - "result": null + "result": { + "result": { + "accessruletype": [ + "allow" + ], + "attributelevelrights": { + "accessruletype": "rscwo", + "accesstime": "rscwo", + "aci": "rscwo", + "cn": "rscwo", + "description": "rscwo", + "externalhost": "rscwo", + "hostcategory": "rscwo", + "ipaenabledflag": "rscwo", + "ipauniqueid": "rsc", + "memberhost": "rscwo", + "memberservice": "rscwo", + "memberuser": "rscwo", + "nsaccountlock": "rscwo", + "servicecategory": "rscwo", + "sourcehost": "rscwo", + "sourcehostcategory": "rscwo", + "usercategory": "rscwo" + }, + "cn": [ + "test" + ], + "description": [ + "Test HBAC rule." + ], + "hostcategory": [ + "all" + ], + "ipaenabledflag": [ + "TRUE" + ], + "ipauniqueid": [ + "4ed8b682-edf511df-b3f78f4b-11cc007b" + ], + "objectclass": [ + "ipaassociation", + "ipahbacrule" + ], + "servicecategory": [ + "all" + ], + "sourcehostcategory": [ + "all" + ], + "usercategory": [ + "all" + ] + }, + "summary": null, + "value": "test" + } } diff --git a/install/static/test/data/hbac_show.json b/install/static/test/data/hbac_show.json index 183a52182..2c0b64b39 100644 --- a/install/static/test/data/hbac_show.json +++ b/install/static/test/data/hbac_show.json @@ -4,19 +4,41 @@ "result": { "result": { "accessruletype": [ - "allow" + "deny" ], "accesstime": [ "periodic daily 0800-1400", "absolute 201012161032 ~ 201012161033" ], + "attributelevelrights": { + "accessruletype": "rscwo", + "accesstime": "rscwo", + "aci": "rscwo", + "cn": "rscwo", + "description": "rscwo", + "externalhost": "rscwo", + "hostcategory": "rscwo", + "ipaenabledflag": "rscwo", + "ipauniqueid": "rsc", + "memberhost": "rscwo", + "memberservice": "rscwo", + "memberuser": "rscwo", + "nsaccountlock": "rscwo", + "servicecategory": "rscwo", + "sourcehost": "rscwo", + "sourcehostcategory": "rscwo", + "usercategory": "rscwo" + }, "cn": [ "test" ], - "dn": "ipauniqueid=e8aca082-e64a11df-9864f2e0-e0578392,cn=hbac,dc=dev,dc=example,dc=com", + "dn": "ipauniqueid=4ed8b682-edf511df-b3f78f4b-11cc007b,cn=hbac,dc=dev,dc=example,dc=com", "ipaenabledflag": [ "TRUE" ], + "ipauniqueid": [ + "4ed8b682-edf511df-b3f78f4b-11cc007b" + ], "memberhost_host": [ "dev.example.com" ], @@ -31,13 +53,16 @@ "sudo" ], "memberuser_group": [ - "admins", "editors" ], "memberuser_user": [ "admin", "test" ], + "objectclass": [ + "ipaassociation", + "ipahbacrule" + ], "sourcehost_host": [ "dev.example.com" ], 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' + ); }); |