Permalink
Browse files

Test changes needed after removing _top and _left attributes, plus fi…

…xing filename, refs #11030.
  • Loading branch information...
1 parent d1791b0 commit 722b16a749d2d2bccc3932a17265d1fb49ef0565 @wkeese wkeese committed Dec 27, 2010
Showing with 25 additions and 12 deletions.
  1. +22 −9 tests/{Widget-placeAt.html → _Widget-placeAt.html}
  2. +3 −3 tests/infrastructure-module.js
@@ -23,7 +23,7 @@
<script type="text/javascript">
dojo.require("doh.runner");
- // load componenets need for this test
+ // load components need for this test
dojo.require("dijit.form.Button");
dojo.require("dijit.layout.TabContainer");
dojo.require("dijit.layout.ContentPane");
@@ -37,7 +37,7 @@
doh.register("dijit.tests.placeAt",
[
function placeAsDOMNodeChild(){
- // create a tabcontainer
+ // create a TabContainer
tc = new dijit.layout.TabContainer({
style: "height:200px; width:200px"
}, "tabContainerThinger").placeAt("container");
@@ -46,7 +46,7 @@
},
function placeAsWidgetChild(){
- // add the child to the tabcontainer now:
+ // add the child to the TabContainer now:
pane1 = new dijit.layout.ContentPane({ title:"empty" }).placeAt(tc);
doh.is(pane1, tc.getChildren()[0], "pane1 is child of TabContainer");
@@ -82,9 +82,9 @@
},
function placeBefore(){
- // and a button, this time we'll place it before the tabcontainer's dom
+ // and a button, this time we'll place it before the TabContainer's dom
var otherButton = new dijit.form.Button({
- label:"destroy tabContainer",
+ label:"destroy TabContainer",
onClick:function(){
tc.destroyRecursive();
}
@@ -100,9 +100,22 @@
// Add top and left pane
dijit.byId("addStuff").onClick();
- var bc = dijit.byId("bc1");
- doh.is("<p>wowzers</p>", bc._left.innerHTML.toLowerCase(), "left pane");
- doh.is("<div>some html text</div>", bc._top.innerHTML.toLowerCase(), "top pane");
+ var bc = dijit.byId("bc1"),
+ children = bc.getChildren();
+
+ doh.is(3, children.length);
+
+ var bcPos = dojo.position(bc.domNode),
+ center = dijit.byId("center"),
+ centerPos = dojo.position(center.domNode),
+ left = dojo.filter(children, function(child){ return child.region == "left";})[0],
+ leftPos = dojo.position(left.domNode),
+ top = dojo.filter(children, function(child){ return child.region == "top";})[0];
+
+ doh.t(leftPos.x >= bcPos.x, "left in BorderContainer");
+ doh.t(centerPos.x >= leftPos.x + leftPos.w, "left vs. center horizontal");
+ doh.is("<p>wowzers</p>", left.domNode.innerHTML.toLowerCase(), "left pane");
+ doh.is("<div>some html text</div>", top.domNode.innerHTML.toLowerCase(), "top pane");
}
]
);
@@ -125,7 +138,7 @@ <h1 class="testTitle">_Widget.placeAt tests</h1>
<h2>BorderContainer sample</h2>
<div id="bc1" data-dojo-type="dijit.layout.BorderContainer" data-dojo-props='style:"width:600px; height:400px"'>
- <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props='region:"center"'>
+ <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props='id:"center", region:"center"'>
<button id="addStuff" data-dojo-type="dijit.form.Button">
Add Stuff
<script type="dojo/method" data-dojo-event="onClick">
@@ -5,7 +5,7 @@ try{
doh.registerUrl("dijit.tests._Widget-lifecycle", dojo.moduleUrl("dijit", "tests/_Widget-lifecycle.html"), 999999);
doh.registerUrl("dijit.tests._Widget-attr", dojo.moduleUrl("dijit", "tests/_Widget-attr.html"), 999999);
doh.registerUrl("dijit.tests._Widget-subscribe", dojo.moduleUrl("dijit", "tests/_Widget-subscribe.html"), 999999);
- doh.registerUrl("dijit.tests.Widget-placeAt", dojo.moduleUrl("dijit", "tests/Widget-placeAt.html"), 999999);
+ doh.registerUrl("dijit.tests._Widget-placeAt", dojo.moduleUrl("dijit", "tests/_Widget-placeAt.html"), 999999);
doh.registerUrl("dijit.tests.robot._Widget-deferredConnect", dojo.moduleUrl("dijit","tests/robot/_Widget-deferredConnect.html"), 999999);
doh.registerUrl("dijit.tests.robot._Widget-ondijitclick_mouse", dojo.moduleUrl("dijit","tests/robot/_Widget-ondijitclick_mouse.html"), 999999);
@@ -21,7 +21,7 @@ try{
doh.registerUrl("dijit.tests.Declaration_1.x", dojo.moduleUrl("dijit","tests/test_Declaration_1.x.html"), 999999);
// Miscellaneous
- doh.registerUrl("dijit.tests.NodeList-instantiate", dojo.moduleUrl("dijit","tests/NodeList-instantiate.html"+userArgs), 999999);
+ doh.registerUrl("dijit.tests.NodeList-instantiate", dojo.moduleUrl("dijit","tests/NodeList-instantiate.html"), 999999);
}catch(e){
doh.debug(e);
-}
+}

0 comments on commit 722b16a

Please sign in to comment.