浏览代码

AMBARI-5667. Fix UI Unit tests. (onechiporenko)

Oleg Nechiporenko 11 年之前
父节点
当前提交
d361930fa2
共有 1 个文件被更改,包括 10 次插入10 次删除
  1. 10 10
      ambari-web/test/views/main/jobs/hive_job_details_tez_dag_view_test.js

+ 10 - 10
ambari-web/test/views/main/jobs/hive_job_details_tez_dag_view_test.js

@@ -23,7 +23,7 @@ describe('App.MainHiveJobDetailsTezDagView', function() {
   var tezDagView = App.MainHiveJobDetailsTezDagView.create();
   var tezDagView = App.MainHiveJobDetailsTezDagView.create();
 
 
   describe('#getNodeCalculatedDimensions()', function() {
   describe('#getNodeCalculatedDimensions()', function() {
-    var tests = [
+    var tests = Em.A([
       {
       {
         i: {
         i: {
           node: {
           node: {
@@ -33,11 +33,11 @@ describe('App.MainHiveJobDetailsTezDagView', function() {
           minDuration: 1
           minDuration: 1
         },
         },
         e: {
         e: {
-          width : 1800,
-          height : 400,
+          width : 180,
+          height : 40,
           drawWidth : 180,
           drawWidth : 180,
           drawHeight : 40,
           drawHeight : 40,
-          scale : 10
+          scale : 1
         },
         },
         m: 'Node(ops=0,duration=100) minDuration=1'
         m: 'Node(ops=0,duration=100) minDuration=1'
       },
       },
@@ -50,11 +50,11 @@ describe('App.MainHiveJobDetailsTezDagView', function() {
           minDuration: 1
           minDuration: 1
         },
         },
         e: {
         e: {
-          width : 360,
-          height : 160,
+          width : 180,
+          height : 80,
           drawWidth : 180,
           drawWidth : 180,
           drawHeight : 40+40,
           drawHeight : 40+40,
-          scale : 2
+          scale : 1
         },
         },
         m: 'Node(ops=5,duration=4) minDuration=1'
         m: 'Node(ops=5,duration=4) minDuration=1'
       },
       },
@@ -92,13 +92,13 @@ describe('App.MainHiveJobDetailsTezDagView', function() {
         },
         },
         m: 'Node(ops=1,duration=1) minDuration=3'
         m: 'Node(ops=1,duration=1) minDuration=3'
       }
       }
-    ];
+    ]);
     tests.forEach(function(test) {
     tests.forEach(function(test) {
       it(test.m, function() {
       it(test.m, function() {
         var nodeDim = tezDagView.getNodeCalculatedDimensions(test.i.node, test.i.minDuration);
         var nodeDim = tezDagView.getNodeCalculatedDimensions(test.i.node, test.i.minDuration);
-        for(var key in test.e) {
+        Em.keys(test.e).forEach(function(key) {
           expect(nodeDim[key]).to.equal(test.e[key]);
           expect(nodeDim[key]).to.equal(test.e[key]);
-        }
+        });
       });
       });
     });
     });
   });
   });