2011-07-01 06:17:45 -04:00
|
|
|
/*
|
2013-01-28 21:03:27 -05:00
|
|
|
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
|
2011-07-01 06:17:45 -04:00
|
|
|
* http://paperjs.org/
|
|
|
|
*
|
2014-01-03 19:47:16 -05:00
|
|
|
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
|
|
|
|
* http://scratchdisk.com/ & http://jonathanpuckey.com/
|
2011-07-01 06:17:45 -04:00
|
|
|
*
|
|
|
|
* Distributed under the MIT license. See LICENSE file for details.
|
|
|
|
*
|
|
|
|
* All rights reserved.
|
|
|
|
*/
|
|
|
|
|
2011-05-16 08:33:15 -04:00
|
|
|
module('Project');
|
2011-02-12 12:07:14 -05:00
|
|
|
|
|
|
|
test('activate()', function() {
|
2011-05-20 09:08:17 -04:00
|
|
|
var project = new Project();
|
2011-05-16 08:33:15 -04:00
|
|
|
var secondDoc = new Project();
|
2011-05-20 09:08:17 -04:00
|
|
|
project.activate();
|
2011-02-12 12:07:14 -05:00
|
|
|
var path = new Path();
|
2011-05-07 12:46:06 -04:00
|
|
|
equals(function() {
|
2011-05-20 09:08:17 -04:00
|
|
|
return project.activeLayer.children[0] == path;
|
2011-05-07 12:46:06 -04:00
|
|
|
}, true);
|
|
|
|
equals(function() {
|
|
|
|
return secondDoc.activeLayer.children.length == 0;
|
|
|
|
}, true);
|
2013-06-20 22:14:47 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
test('clear()', function() {
|
|
|
|
var project = new Project();
|
|
|
|
new Layer();
|
|
|
|
new Layer();
|
|
|
|
equals(project.layers.length, 3);
|
|
|
|
project.clear();
|
|
|
|
equals(project.layers.length, 0);
|
|
|
|
});
|