Sha256: 95f6f9026b87f06352e0aee2950b9133da71732757e7b817ec3a0feb51af936e

Contents?: true

Size: 1.67 KB

Versions: 2

Compression:

Stored size: 1.67 KB

Contents

<!DOCTYPE html>
<html>
	<head>
		<title>Parser args Unit Test</title>
		<style type="text/css">     
			@import "../../resources/dojo.css";
		</style>
		<script type="text/javascript" src="../../dojo.js" data-dojo-config="isDebug:true, async:true"></script>
		<script type="text/javascript">
		require(["dojo/ready", "dojo/_base/lang", "dojo/_base/declare", "doh", "dojo/parser", "dojo/domReady!"],
				function(ready, dlang, declare, doh, parser){

			var mixin = dlang.mixin,
				extend = dlang.extend,
				exists = dlang.exists;

			declare("tests.parser.Class1", null, {
				constructor: function(args, node){
					this.params = args;
					mixin(this, args);
				}, 
				strProp1: "original1",
				strProp2: "original2"
			});

			ready(function(){
				doh.register("args scope test", [
					function noArgs(){
						// Test calling parse() with no arguments.
						var widgets = parser.parse();
						doh.is(1, widgets.length, "found 1 widget");
						doh.is("text", widgets[0].strProp1);
					},
					function optionsOnly(){
						// Test when only the options argument is passed, and it does not contain a rootNode.
						// For 2.0, if we drop scope parameter, change this test.
						var widgets = parser.parse({
							scope: "myscope"
						});
						doh.is(1, widgets.length, "found 1 widget");
						doh.is("text", scopeObj.strProp1);
					}
				]);
				doh.run();
			});
		});
		</script>
	</head>
	<body>
		<h1>Parser args Unit Test</h1>

		<div data-myscope-type="tests.parser.Class1" data-myscope-id="scopeObj"
			 data-myscope-props="strProp1:'text'">
		</div>
		<div data-dojo-type="tests.parser.Class1" data-dojo-id="normalObj"
			 data-dojo-props="strProp1:'text'">
		</div>
	</body>
</html>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dojo_rails-0.0.2 vendor/assets/javascripts/dojo/tests/parser/parser-args.html
dojo_rails-0.0.1 vendor/assets/javascripts/dojo/tests/parser/parser-args.html