diff options
author | Endi Sukma Dewata <edewata@redhat.com> | 2010-09-28 10:19:05 -0400 |
---|---|---|
committer | Adam Young <ayoung@redhat.com> | 2010-09-28 10:20:14 -0400 |
commit | d966056bb0e24693fcd05be690f724e921492df3 (patch) | |
tree | e86d058f0dd3a43c0123faec6e017e1829fc2325 /install/static/test/entity_tests.js | |
parent | 370c1c3e0e1fb357bbecc4b1e4a59e822e942548 (diff) | |
download | freeipa.git-d966056bb0e24693fcd05be690f724e921492df3.tar.gz freeipa.git-d966056bb0e24693fcd05be690f724e921492df3.tar.xz freeipa.git-d966056bb0e24693fcd05be690f724e921492df3.zip |
Test suite for association.
New test cases have been added to test SerialAssociator and
BulkAssociator using mockup objects. Also fixed a bug in BulkAssociator.
Moved switch_view() out of ipa_entity_generate_views() in entity.js
to allow unit testing using mockup objects. Updated the test case
to validate click event on facets.
Diffstat (limited to 'install/static/test/entity_tests.js')
-rw-r--r-- | install/static/test/entity_tests.js | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/install/static/test/entity_tests.js b/install/static/test/entity_tests.js index 297928ba..78fa2d4f 100644 --- a/install/static/test/entity_tests.js +++ b/install/static/test/entity_tests.js @@ -78,7 +78,13 @@ test("Testing ipa_entity_generate_views().", function() { ); var container = $("<div/>"); - ipa_entity_generate_views("user", container); + + var counter = 0; + var callback = function() { + counter++; + }; + + ipa_entity_generate_views("user", container, callback); var list = container.children(); var facets = list.children(); @@ -92,16 +98,20 @@ test("Testing ipa_entity_generate_views().", function() { equals( search.attr("title"), "search", - "Checking the first facet" + "Checking the search facet" ) + search.click(); + var details = search.next(); equals( details.attr("title"), "details", - "Checking the second facet" + "Checking the details facet" ) + details.click(); + var facet = details.next(); var attribute_members = ipa_objs["user"].attribute_members; for (attribute_member in attribute_members) { @@ -111,10 +121,17 @@ test("Testing ipa_entity_generate_views().", function() { equals( facet.attr("title"), object, - "Checking the next facet" + "Checking the "+object+" facet" ); + facet.click(); + facet = facet.next(); } } + + equals( + counter, 6, + "Checking callback invocations" + ); }); |