瀏覽代碼

HUE-3465 [editor] Fix broken jasmine tests

Johan Ahlen 9 年之前
父節點
當前提交
8cef026b71
共有 1 個文件被更改,包括 18 次插入7 次删除
  1. 18 7
      desktop/core/src/desktop/static/desktop/spec/sqlAutocompleterSpec.js

+ 18 - 7
desktop/core/src/desktop/static/desktop/spec/sqlAutocompleterSpec.js

@@ -69,14 +69,24 @@ define([
         }
         response.called = true;
         response.status = 0;
-        options.success(response);
-        return({
+        if (typeof options.success === 'function') {
+          options.success(response);
+        }
+
+        var functions = {
           fail: function() {
-            return {
-              always: $.noop
-            }
+            return functions;
+          },
+          done: function(success) {
+            success(response);
+            return functions;
+          },
+          always: function() {
+            return functions;
           }
-        })
+        };
+
+        return functions;
       });
     });
 
@@ -936,7 +946,8 @@ define([
             },
             "/notebook/api/sample/database_one/testTable/id": {
               status: 0,
-              headers: []
+              headers: [],
+              rows: []
             }
           },
           beforeCursor: "SELECT * FROM testTable WHERE id =",