mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Move JSON test helpers to JSON file since they are only used there.
This commit is contained in:
parent
e854254986
commit
3613086a64
2 changed files with 9 additions and 10 deletions
|
@ -405,16 +405,6 @@ function compareProjects(project, project2) {
|
|||
}
|
||||
}
|
||||
|
||||
// JSON
|
||||
|
||||
function testExportImportJson(project) {
|
||||
var json = project.exportJson();
|
||||
var project2 = new Project();
|
||||
project2.activeLayer.remove();
|
||||
project2.importJson(json);
|
||||
compareProjects(project2, project);
|
||||
}
|
||||
|
||||
// SVG
|
||||
|
||||
function createSvg(xml) {
|
||||
|
|
|
@ -12,12 +12,21 @@
|
|||
|
||||
module('JSON');
|
||||
|
||||
function testExportImportJson(project) {
|
||||
var json = project.exportJson();
|
||||
var project2 = new Project();
|
||||
project2.activeLayer.remove();
|
||||
project2.importJson(json);
|
||||
compareProjects(project2, project);
|
||||
}
|
||||
|
||||
test('Circles', function() {
|
||||
var topLeft = new Point(200, 200);
|
||||
var size = new Size(150, 100);
|
||||
var rectangle = new Rectangle(topLeft, size);
|
||||
var path = new Path.Ellipse(rectangle);
|
||||
path.fillColor = 'black';
|
||||
console.log('JSON', path.exportJson());
|
||||
|
||||
var topLeft = new Point(5, 400);
|
||||
var size = new Size(100, 50);
|
||||
|
|
Loading…
Reference in a new issue