浏览代码

fix light json check

simonThiele 9 年之前
父节点
当前提交
b89da830de
共有 1 个文件被更改,包括 6 次插入4 次删除
  1. 6 4
      test/unit/qunit-utils.js

+ 6 - 4
test/unit/qunit-utils.js

@@ -207,9 +207,11 @@ function checkLightClone( light ) {
 function checkLightJsonWriting( light, json ) {
 
 	QUnit.assert.equal( json.metadata.version, "4.4", "check metadata version" );
-	QUnit.assert.equalKey( light, json, 'type' );
-	QUnit.assert.equalKey( light, json, 'uuid' );
-	QUnit.assert.equal( json.id, undefined, "should not persist id" );
+
+	var object = json.object;
+	QUnit.assert.equalKey( light, object, 'type' );
+	QUnit.assert.equalKey( light, object, 'uuid' );
+	QUnit.assert.equal( object.id, undefined, "should not persist id" );
 
 }
 
@@ -227,7 +229,7 @@ function checkLightJsonReading( json, light ) {
 function checkLightJsonRoundtrip( light ) {
 
 	var json = light.toJSON();
-	checkLightJsonWriting( light, json.object );
+	checkLightJsonWriting( light, json );
 	checkLightJsonReading( json, light );
 
 }