when a new stage is instantiated, it now clears the container DOM element

This commit is contained in:
Eric Rowell
2013-06-08 14:29:58 -07:00
parent 79c3124ed7
commit e8c9e7966f
2 changed files with 20 additions and 2 deletions

View File

@@ -6,7 +6,6 @@ Test.Modules.STAGE = {
height: 200
});
},
'instantiate stage with dom element': function(containerId) {
var containerDom = document.getElementById(containerId);
var stage = new Kinetic.Stage({
@@ -15,6 +14,19 @@ Test.Modules.STAGE = {
height: 200
});
},
'stage instantiation should clear container': function(containerId) {
var container = document.getElementById(containerId);
var dummy = document.createElement('p');
container.appendChild(dummy);
var stage = new Kinetic.Stage({
container: containerId,
width: 578,
height: 200
});
test(container.getElementsByTagName('p').length === 0, 'container should have no p tags');
},
'set stage size': function(containerId) {
var stage = new Kinetic.Stage({
container: containerId,