stage clone has new container. fix #707

This commit is contained in:
Лаврёнов Антон
2014-03-07 22:51:26 +08:00
parent 452c99cb4e
commit d65201a12f
5 changed files with 53 additions and 6 deletions

View File

@@ -73,6 +73,19 @@ suite('Stage', function() {
assert.equal(container.getElementsByTagName('p').length, 0, 'container should have no p tags');
});
// ======================================================
test('test stage cloning', function() {
var stage = addStage();
var layer = new Kinetic.Layer();
stage.add(layer);
var stageClone = stage.clone();
assert.notEqual(stage.getContainer(), stageClone.getContainer(), 'clone should be in different container');
assert.equal(stage.getContainer().childNodes[0].childNodes.length, 1, 'container should not have changes');
});
// ======================================================
test('set stage size', function() {
var stage = addStage();