summaryrefslogtreecommitdiffstats
path: root/install/ui/test
diff options
context:
space:
mode:
authorAdam Young <ayoung@redhat.com>2011-02-07 23:02:43 -0500
committerAdam Young <ayoung@redhat.com>2011-02-11 15:04:31 -0500
commit6f6d50f37f21db2a5591fa44c962eea04b82f596 (patch)
tree906b835cf90afc05b7ccfec53d2c4df34b12dccc /install/ui/test
parent3ac3130fc9daf853368947b268d9af4b8a67d247 (diff)
downloadfreeipa-6f6d50f37f21db2a5591fa44c962eea04b82f596.tar.gz
freeipa-6f6d50f37f21db2a5591fa44c962eea04b82f596.tar.xz
freeipa-6f6d50f37f21db2a5591fa44c962eea04b82f596.zip
target section without radio buttons ACI target section refactored into an array of widget-like objects. The radio buttons have been replaced by a select box. THe select is not visible on the details page.
Diffstat (limited to 'install/ui/test')
-rw-r--r--install/ui/test/aci_tests.js41
1 files changed, 31 insertions, 10 deletions
diff --git a/install/ui/test/aci_tests.js b/install/ui/test/aci_tests.js
index d1a5cb6bf..ff8b5de04 100644
--- a/install/ui/test/aci_tests.js
+++ b/install/ui/test/aci_tests.js
@@ -130,33 +130,54 @@ test("IPA.rights_widget.", function() {
test("Testing aci grouptarget.", function() {
var sample_data_filter_only = {"targetgroup":"ipausers"};
target_section.load(sample_data_filter_only);
- ok($('#aci_by_group')[0].checked, 'aci_by_group control selected');
- ok ($('#targetgroup-entity-select option').length > 2,'group select populated');
-});
+ var selected = $(target_section.type_select+":selected");
+ same(selected.val(), 'targetgroup' , 'group control selected');
+ ok ($('#targetgroup-entity-select option').length > 2,
+ 'group select populated');
+});
-test("Testing aci object type.", function() {
+test("Testing type target.", function() {
var sample_data_filter_only = {"type":"hostgroup"};
+
target_section.load(sample_data_filter_only);
- ok($('.aci-attribute', target_container).length > 4);
- ok($('#aci_by_type')[0].checked, 'aci_by_type control selected');
+ var selected = $(target_section.type_select+":selected");
+ same(selected.val(), 'type', 'type selected');
+
+ $("input[type=checkbox]").attr("checked",true);
+ var response_record = {};
+ target_section.save(response_record);
+ same(response_record.type, sample_data_filter_only.type,
+ "saved type matches sample data");
+ ok((response_record.attrs.length > 10),
+ "response length shows some attrs set");
});
-test("Testing aci filter only.", function() {
+test("Testing filter target.", function() {
var sample_data_filter_only = {"filter":"somevalue"};
target_section.load(sample_data_filter_only);
- var filter_radio = $('#aci_by_filter');
+ var selected = $(target_section.type_select+":selected");
+ same(selected.val(), 'filter', 'filter selected');
+});
+
+
+
+test("Testing subtree target.", function() {
- ok(filter_radio.length,'find "filter_only_radio" control');
- ok(filter_radio[0].checked,'filter_only_radio control is checked');
+ var sample_data = {
+ subtree:"ldap:///cn=*,cn=roles,cn=accounts,dc=example,dc=co"};
+ target_section.load(sample_data);
+ var record = {};
+ target_section.save(record);
+ same(record.subtree, sample_data.subtree, 'subtree set correctly');
});