[Pkg-javascript-commits] [dojo] 20/149: refs #18288, add dom-attr tests

David Prévot taffit at moszumanska.debian.org
Sat Feb 27 03:13:43 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository dojo.

commit 2d2e981b5129c6dbca28bc18895a72c3e9305d3a
Author: Benjamin Santalucia <ben at dojotoolkit-fr.org>
Date:   Tue Sep 30 16:47:26 2014 -0700

    refs #18288, add dom-attr tests
---
 tests/dom-attr.html | 41 +++++++++++++++++++++++++++++++++++++++++
 tests/dom-attr.js   |  3 +++
 tests/module.js     |  1 +
 3 files changed, 45 insertions(+)

diff --git a/tests/dom-attr.html b/tests/dom-attr.html
new file mode 100644
index 0000000..cf127b3
--- /dev/null
+++ b/tests/dom-attr.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+	<head>
+		<title>testing dom-prop</title>
+		<script src="../dojo.js" data-dojo-config="isDebug:true"></script>
+		<script>
+			require(["dojo", "doh", "dojo/dom-attr", "dojo/dom", "dojo/domReady!"], function(dojo, doh, domAttr, dom){
+				doh.register([
+					{
+						name: "set / get value attribute",
+						runTest: function(t){
+							var test1 = dom.byId("test1"),
+								test2 = dom.byId("test2"),
+								value1 = domAttr.get(test1, "value"),
+								value2 = domAttr.get(test2, "value");
+
+							doh.is('6', value1);
+							doh.is('bar', value2);
+							
+							domAttr.set(test1, "value", "10");
+							domAttr.set(test2, "value", "foo");
+							
+							value1 = domAttr.get(test1, "value");
+							value2 = domAttr.get(test2, "value");
+							
+							doh.is('10', value1);
+							doh.is('foo', value2);
+							
+						}
+					}
+				]);
+
+				doh.run();
+			});
+		</script>
+	</head>
+	<body>
+		<meter id="test1" min="5" max="10" value="6"></meter>
+		<input id="test2" value="bar" />
+	</body>
+</html>
diff --git a/tests/dom-attr.js b/tests/dom-attr.js
new file mode 100644
index 0000000..c1fbd09
--- /dev/null
+++ b/tests/dom-attr.js
@@ -0,0 +1,3 @@
+define(["doh/main", "require"], function(doh, require){
+	doh.register("tests.dom-attr", require.toUrl("./dom-attr.html"), 30000);
+});
diff --git a/tests/module.js b/tests/module.js
index cbb4b09..ba0750e 100644
--- a/tests/module.js
+++ b/tests/module.js
@@ -28,6 +28,7 @@ define([
 	"dojo/tests/errors",
 	"dojo/tests/text",
 	"dojo/has!host-node?dojo/tests/node",
+	"dojo/has!host-browser?dojo/tests/dom-attr",
 	"dojo/has!host-browser?dojo/tests/dom-prop",
 	"dojo/has!host-browser?dojo/tests/dom-construct",
 	"dojo/has!host-browser?dojo/tests/router",

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/dojo.git



More information about the Pkg-javascript-commits mailing list