diff options
author | Adam Young <ayoung@redhat.com> | 2010-09-29 16:57:07 -0400 |
---|---|---|
committer | Adam Young <ayoung@redhat.com> | 2010-09-30 09:49:46 -0400 |
commit | df5fa8b71b08d72ccc45ee08db1fd42a4c6d7ab6 (patch) | |
tree | f699ab6549219a61cdf141e4ccee4acc7195df82 /install/static/test | |
parent | c82b4d91bf344ad731c2efef0bde1b4db9f59210 (diff) | |
download | freeipa.git-df5fa8b71b08d72ccc45ee08db1fd42a4c6d7ab6.tar.gz freeipa.git-df5fa8b71b08d72ccc45ee08db1fd42a4c6d7ab6.tar.xz freeipa.git-df5fa8b71b08d72ccc45ee08db1fd42a4c6d7ab6.zip |
Item Level Undo
Also adding some unit tests for details.
Using JQuery UI buttons for update and reset
Now triggers on keydown, not change
Diffstat (limited to 'install/static/test')
-rw-r--r-- | install/static/test/all_tests.html | 1 | ||||
-rw-r--r-- | install/static/test/data/json_metadata.json | 2 | ||||
-rw-r--r-- | install/static/test/details_tests.html | 22 | ||||
-rw-r--r-- | install/static/test/details_tests.js | 92 | ||||
-rw-r--r-- | install/static/test/index.html | 1 |
5 files changed, 117 insertions, 1 deletions
diff --git a/install/static/test/all_tests.html b/install/static/test/all_tests.html index 93c4de23..aede08e7 100644 --- a/install/static/test/all_tests.html +++ b/install/static/test/all_tests.html @@ -15,6 +15,7 @@ <script type="text/javascript" src="../associate.js"></script> <script type="text/javascript" src="../navigation.js"></script> <script type="text/javascript" src="ipa_tests.js"></script> + <script type="text/javascript" src="details_tests.js"></script> <script type="text/javascript" src="entity_tests.js"></script> <script type="text/javascript" src="association_tests.js"></script> <script type="text/javascript" src="navigation_tests.js"></script> diff --git a/install/static/test/data/json_metadata.json b/install/static/test/data/json_metadata.json index ef8c77bc..b4f97985 100644 --- a/install/static/test/data/json_metadata.json +++ b/install/static/test/data/json_metadata.json @@ -3103,7 +3103,7 @@ "doc": "User login", "exclude": null, "flags": [], - "hint": null, + "hint": "Numeric user Identifer", "include": null, "label": "User login", "length": null, diff --git a/install/static/test/details_tests.html b/install/static/test/details_tests.html new file mode 100644 index 00000000..e1b35251 --- /dev/null +++ b/install/static/test/details_tests.html @@ -0,0 +1,22 @@ +<!DOCTYPE html> +<html> +<head> + <title>Details Test Suite</title> + <link rel="stylesheet" href="qunit.css" type="text/css" media="screen"> + <script type="text/javascript" src="qunit.js"></script> + <script type="text/javascript" src="../jquery.js"></script> + <script type="text/javascript" src="../jquery.ba-bbq.js"></script> + <script type="text/javascript" src="../jquery-ui.js"></script> + <script type="text/javascript" src="../ipa.js"></script> + <script type="text/javascript" src="../details.js"></script> + <script type="text/javascript" src="details_tests.js"></script> +</head> +<body> + <h1 id="qunit-header">Details Test Suite</h1> + <h2 id="qunit-banner"></h2> + <div id="qunit-testrunner-toolbar"></div> + <h2 id="qunit-userAgent"></h2> + <ol id="qunit-tests"></ol> + <div id="qunit-fixture">test markup</div> +</body> +</html> diff --git a/install/static/test/details_tests.js b/install/static/test/details_tests.js new file mode 100644 index 00000000..ee5d3961 --- /dev/null +++ b/install/static/test/details_tests.js @@ -0,0 +1,92 @@ +/* Authors: + * Adam Young <ayoung@redhat.com> + * + * Copyright (C) 2010 Red Hat + * see file 'COPYING' for use and warranty information + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 only + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + + +test("Testing ipa_details_create().", function() { + + var details = [ + ['identity', 'Entity Details', [ + ['cn', 'Entity Name'], + ['description', 'Description'], + ['number', 'Entity ID'] + ]] + ]; + + var identity = details[0]; + var attrs=identity[2]; + var key = 'entity'; + + var container = $("<div/>",{id: "container"}); + ipa_details_create(key, details, container) + + same(container[0].title,key); + var dl = container.find('dl#identity'); + ok(dl ); + + same(dl[0].children.length, attrs.length); + +}); + + +test("Testing _ipa_create_text_input().", function(){ + + var name = "name"; + var value="value"; + var input = _ipa_create_text_input(name, value); + ok(input,"input not null"); + + same(input[0].name,name ); + same(input[0].value,value ); + same(input[0].type,"text" ); +}); + + + +test("Testing ipa_generate_dl()",function(){ + + var details = [ + ['cn', 'Entity Name'], + ['description', 'Description'], + ['number', 'Entity ID'] + ]; + var name = 'NAMENAMENAME'; + var identity = 'IDIDID'; + var parent = $("<div/>"); + var jobj = $("<div title='entity'/>"); + parent.append(jobj); + ipa_generate_dl(jobj, identity,name, details); + + ok(parent.find('hr')); + + var h2= parent.find('h2'); + ok(h2); + ok(h2[0].innerHTML.indexOf(name) > 1,"find name in html"); + + var dl = parent.find('dl'); + ok(dl); + same(dl[0].children.length,3); + same(dl[0].id, identity); + same(dl[0].children[0].title,details[0][0]); + same(dl[0].children[0].innerHTML,details[0][1]+":"); + same(dl[0].children[2].title,details[2][0]); + same(dl[0].children[2].innerHTML,details[2][1]+":"); + +});
\ No newline at end of file diff --git a/install/static/test/index.html b/install/static/test/index.html index 5c4607ae..a71ee60f 100644 --- a/install/static/test/index.html +++ b/install/static/test/index.html @@ -26,6 +26,7 @@ <ul> <li><a href="ipa_tests.html">Core Test Suite</a> <li><a href="entity_tests.html">Entity Test Suite</a> + <li><a href="details_tests.html">Details Test Suite</a> <li><a href="association_tests.html">Association Test Suite</a> <li><a href="navigation_tests.html">Navigation Test Suite</a> |