mirror of
https://github.com/konvajs/konva.git
synced 2026-01-18 19:51:21 +08:00
when a new stage is instantiated, it now clears the container DOM element
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user