Move JSON test helpers to JSON file since they are only used there.

This commit is contained in:
Jürg Lehni 2013-03-19 16:23:05 -07:00
parent e854254986
commit 3613086a64
2 changed files with 9 additions and 10 deletions

View file

@ -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) {

View file

@ -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);