paper.js/test/tests/Project.js

37 lines
895 B
JavaScript
Raw Permalink Normal View History

2011-07-01 06:17:45 -04:00
/*
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
2011-07-01 06:17:45 -04:00
* http://paperjs.org/
*
* 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.
*/
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);
});
test('clear()', function() {
var project = new Project();
new Layer();
new Layer();
new Layer();
equals(project.layers.length, 3);
project.clear();
equals(project.layers.length, 0);
});