summaryrefslogtreecommitdiffstats
path: root/install/ui/test/aci_tests.js
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2011-11-18 19:47:39 -0600
committerEndi S. Dewata <edewata@redhat.com>2011-12-06 22:08:07 +0000
commitcaa9d52666e5beb7321dc6c80820eeacca356077 (patch)
tree01b91c26442e559632afbf652968c0dbd9c0291b /install/ui/test/aci_tests.js
parenta8ea42bda841c8773d68886614faf9efd38e33bd (diff)
downloadfreeipa-caa9d52666e5beb7321dc6c80820eeacca356077.tar.gz
freeipa-caa9d52666e5beb7321dc6c80820eeacca356077.tar.xz
freeipa-caa9d52666e5beb7321dc6c80820eeacca356077.zip
Refactored facet.load().
The load() in IPA.facet has been modified to accept the complete data returned by the server instead of just the result. This is needed by HBAC Test to access other attributes returned in the test result. Ticket #388
Diffstat (limited to 'install/ui/test/aci_tests.js')
-rw-r--r--install/ui/test/aci_tests.js40
1 files changed, 28 insertions, 12 deletions
diff --git a/install/ui/test/aci_tests.js b/install/ui/test/aci_tests.js
index 2881fa23b..8f8e8b571 100644
--- a/install/ui/test/aci_tests.js
+++ b/install/ui/test/aci_tests.js
@@ -185,8 +185,13 @@ var get_visible_rows = function(section) {
};
test("Testing aci grouptarget.", function() {
- var sample_data_filter_only = { targetgroup:"ipausers" };
- target_facet.load(sample_data_filter_only);
+ var data = {};
+ data.result = {};
+ data.result.result = {
+ targetgroup: 'ipausers'
+ };
+
+ target_facet.load(data);
same(target_widget.target, 'targetgroup' , 'group control selected');
@@ -200,9 +205,13 @@ test("Testing aci grouptarget.", function() {
});
test("Testing type target.", function() {
- var sample_data = { type:"hostgroup" };
+ var data = {};
+ data.result = {};
+ data.result.result = {
+ type: 'hostgroup'
+ };
- target_facet.load(sample_data);
+ target_facet.load(data);
same(target_widget.target, 'type', 'type selected');
@@ -210,7 +219,7 @@ test("Testing type target.", function() {
var record = {};
target_facet.save(record);
- same(record.type[0], sample_data.type,
+ same(record.type[0], data.result.result.type,
"saved type matches sample data");
same(get_visible_rows(target_widget), ['type', 'attrs'],
@@ -223,9 +232,13 @@ test("Testing type target.", function() {
test("Testing filter target.", function() {
- var sample_data = { filter:"somevalue" };
+ var data = {};
+ data.result = {};
+ data.result.result = {
+ filter: 'somevalue'
+ };
- target_facet.load(sample_data);
+ target_facet.load(data);
var record = {};
target_facet.save(record);
@@ -234,21 +247,24 @@ test("Testing filter target.", function() {
same(get_visible_rows(target_widget), ['filter'], 'filter row visible');
- ok(record.filter[0], sample_data.filter, 'filter set correctly');
+ ok(record.filter[0], data.result.result.filter, 'filter set correctly');
});
test("Testing subtree target.", function() {
- var sample_data = {
- subtree:"ldap:///cn=*,cn=roles,cn=accounts,dc=example,dc=co"};
+ var data = {};
+ data.result = {};
+ data.result.result = {
+ subtree: 'ldap:///cn=*,cn=roles,cn=accounts,dc=example,dc=co'
+ };
- target_facet.load(sample_data);
+ target_facet.load(data);
var record = {};
target_facet.save(record);
- same(record.subtree[0], sample_data.subtree, 'subtree set correctly');
+ same(record.subtree[0], data.result.result.subtree, 'subtree set correctly');
same(get_visible_rows(target_widget), ['subtree'], 'subtree row visible');
});