1 | <!DOCTYPE html> |
---|
2 | <html> |
---|
3 | <head> |
---|
4 | <title>Fieldset Widget Automated (non-robot) Tests</title> |
---|
5 | |
---|
6 | <script type="text/javascript" src="boilerplate.js"></script> |
---|
7 | |
---|
8 | <script type="text/javascript"> |
---|
9 | require([ |
---|
10 | "doh/runner", |
---|
11 | "dojo/dom", "dojo/on", "dojo/parser", |
---|
12 | "dijit/Fieldset", |
---|
13 | "dojo/domReady!" |
---|
14 | ], function(doh, dom, on, parser, Fieldset){ |
---|
15 | |
---|
16 | doh.register("declarative", function(){ |
---|
17 | var d = new doh.Deferred(); |
---|
18 | |
---|
19 | parser.parse(); |
---|
20 | |
---|
21 | doh.t(!!fs1, "widget created"); |
---|
22 | doh.t(fs1.open, "open"); |
---|
23 | doh.is("Declarative", fs1.titleNode.innerHTML); |
---|
24 | |
---|
25 | on.emit(fs1.titleNode, "click", {bubbles: true}); |
---|
26 | setTimeout(d.getTestCallback(function(){ |
---|
27 | doh.f(fs1.open, "closed"); |
---|
28 | doh.is("none", fs1.hideNode.style.display, "hidden") |
---|
29 | }), 500); |
---|
30 | |
---|
31 | return d; |
---|
32 | }); |
---|
33 | |
---|
34 | doh.register("programmatic", function(){ |
---|
35 | var fs2 = (new Fieldset({ |
---|
36 | id: 'fs2', |
---|
37 | title: 'Programmatic', |
---|
38 | content: '<p>I was created programmatically!</p>' |
---|
39 | })).placeAt(document.body); |
---|
40 | doh.t(!!fs2, "widget created"); |
---|
41 | }); |
---|
42 | |
---|
43 | doh.run(); |
---|
44 | }); |
---|
45 | </script> |
---|
46 | </head> |
---|
47 | <body class="claro"> |
---|
48 | <h1 class="testTitle">Fieldset Automated (non-robot) tests</h1> |
---|
49 | <fieldset id="fs1" data-dojo-id="fs1" data-dojo-type="dijit/Fieldset"> |
---|
50 | <legend>Declarative</legend> |
---|
51 | <p>Some content</p> |
---|
52 | </fieldset> |
---|
53 | </body> |
---|
54 | </html> |
---|
55 | |
---|
56 | |
---|