Skip to content

Commit

Permalink
Test changes needed after removing _top and _left attributes, plus fi…
Browse files Browse the repository at this point in the history
…xing filename, refs #11030.
  • Loading branch information
wkeese committed Dec 27, 2010
1 parent d1791b0 commit 722b16a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 12 deletions.
31 changes: 22 additions & 9 deletions tests/Widget-placeAt.html → tests/_Widget-placeAt.html
Expand Up @@ -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");
Expand All @@ -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");
Expand All @@ -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");
Expand Down Expand Up @@ -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();
}
Expand All @@ -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");
}
]
);
Expand All @@ -125,7 +138,7 @@ <h2>Node2</h2>

<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">
Expand Down
6 changes: 3 additions & 3 deletions tests/infrastructure-module.js
Expand Up @@ -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);

Expand All @@ -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.