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/
|
|
|
|
*
|
2020-05-23 16:24:42 -04:00
|
|
|
* Copyright (c) 2011 - 2020, Jürg Lehni & Jonathan Puckey
|
|
|
|
* http://juerglehni.com/ & https://puckey.studio/
|
2011-07-01 06:17:45 -04:00
|
|
|
*
|
|
|
|
* Distributed under the MIT license. See LICENSE file for details.
|
|
|
|
*
|
|
|
|
* All rights reserved.
|
|
|
|
*/
|
|
|
|
|
2016-01-27 13:57:07 -05:00
|
|
|
QUnit.module('Project');
|
2011-02-12 12:07:14 -05:00
|
|
|
|
|
|
|
test('activate()', function() {
|
2014-08-16 13:24:54 -04:00
|
|
|
var project = new Project();
|
|
|
|
var secondDoc = new Project();
|
|
|
|
project.activate();
|
|
|
|
var path = new Path();
|
|
|
|
equals(function() {
|
|
|
|
return project.activeLayer.children[0] == path;
|
|
|
|
}, 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();
|
2014-09-27 16:31:49 -04:00
|
|
|
new Layer();
|
2013-06-20 22:14:47 -04:00
|
|
|
equals(project.layers.length, 3);
|
|
|
|
project.clear();
|
|
|
|
equals(project.layers.length, 0);
|
|
|
|
});
|