ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From atk...@apache.org
Subject ambari git commit: AMBARI-9933 UI stucks on manual step during RU (can be skipped). (atkach)
Date Thu, 05 Mar 2015 09:58:42 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk cac52fd91 -> d385af880


AMBARI-9933 UI stucks on manual step during RU (can be skipped). (atkach)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d385af88
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d385af88
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d385af88

Branch: refs/heads/trunk
Commit: d385af880df04690bcd56a562391914541dfe145
Parents: cac52fd
Author: Andrii Tkach <atkach@hortonworks.com>
Authored: Thu Mar 5 11:58:33 2015 +0200
Committer: Andrii Tkach <atkach@hortonworks.com>
Committed: Thu Mar 5 11:58:33 2015 +0200

----------------------------------------------------------------------
 .../main/admin/stack_and_upgrade_controller.js         |  1 +
 .../main/admin/stack_and_upgrade_controller_test.js    | 13 +++++++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d385af88/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js b/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
index aad5b46..98c0ed7 100644
--- a/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
+++ b/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
@@ -184,6 +184,7 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage,
    * @param data
    */
   loadUpgradeDataSuccessCallback: function (data) {
+    if (Em.isNone(data)) return;
     App.set('upgradeState', data.Upgrade.request_status);
     this.setDBProperty('upgradeState', data.Upgrade.request_status);
     if (data.upgrade_groups) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/d385af88/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js b/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js
index 33ce539..acd56b1 100644
--- a/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js
+++ b/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js
@@ -153,11 +153,13 @@ describe('App.MainAdminStackAndUpgradeController', function() {
   describe("#loadUpgradeDataSuccessCallback()", function() {
     beforeEach(function () {
       sinon.stub(controller, 'updateUpgradeData', Em.K);
+      sinon.stub(controller, 'setDBProperty', Em.K);
     });
     afterEach(function () {
       controller.updateUpgradeData.restore();
+      controller.setDBProperty.restore();
     });
-    it("", function() {
+    it("correct data", function() {
       var data = {
         "Upgrade": {
           "request_status": "UPGRADED"
@@ -172,7 +174,14 @@ describe('App.MainAdminStackAndUpgradeController', function() {
         ]};
       controller.loadUpgradeDataSuccessCallback(data);
       expect(App.get('upgradeState')).to.equal('UPGRADED');
-      expect(controller.updateUpgradeData.called).to.be.true;
+      expect(controller.updateUpgradeData.calledOnce).to.be.true;
+      expect(controller.setDBProperty.calledWith('upgradeState', 'UPGRADED')).to.be.true;
+    });
+    it("data is null", function() {
+      var data = null;
+      controller.loadUpgradeDataSuccessCallback(data);
+      expect(controller.updateUpgradeData.called).to.be.false;
+      expect(controller.setDBProperty.called).to.be.false;
     });
   });
 


Mime
View raw message