Repository: ambari Updated Branches: refs/heads/branch-2.6 1cb4ee144 -> 34aa2fc1d
AMBARI-22028 Downgrade button TypeError. (atkach) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/34aa2fc1 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/34aa2fc1 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/34aa2fc1 Branch: refs/heads/branch-2.6 Commit: 34aa2fc1d04788bfb42619367a4feac8c1a7b25d Parents: 1cb4ee1 Author: Andrii Tkach <[email protected]> Authored: Thu Sep 21 17:50:55 2017 +0300 Committer: Andrii Tkach <[email protected]> Committed: Thu Sep 21 17:50:55 2017 +0300 ---------------------------------------------------------------------- .../app/controllers/global/cluster_controller.js | 1 + .../controllers/global/cluster_controller_test.js | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/34aa2fc1/ambari-web/app/controllers/global/cluster_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/global/cluster_controller.js b/ambari-web/app/controllers/global/cluster_controller.js index f6e4da4..bb91852 100644 --- a/ambari-web/app/controllers/global/cluster_controller.js +++ b/ambari-web/app/controllers/global/cluster_controller.js @@ -324,6 +324,7 @@ App.ClusterController = Em.Controller.extend(App.ReloadPopupMixin, { App.stackUpgradeHistoryMapper.map(data); upgradeController.loadStackVersionsToModel(true).done(function () { upgradeController.loadCompatibleVersions(); + upgradeController.updateCurrentStackVersion(); App.set('stackVersionsAvailable', App.StackVersion.find().content.length > 0); }); }); http://git-wip-us.apache.org/repos/asf/ambari/blob/34aa2fc1/ambari-web/test/controllers/global/cluster_controller_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/global/cluster_controller_test.js b/ambari-web/test/controllers/global/cluster_controller_test.js index 84f5f35..2f8ecac 100644 --- a/ambari-web/test/controllers/global/cluster_controller_test.js +++ b/ambari-web/test/controllers/global/cluster_controller_test.js @@ -445,8 +445,10 @@ describe('App.clusterController', function () { restoreLastUpgrade: Em.K, initDBProperties: Em.K, loadUpgradeData: Em.K, + loadCompatibleVersions: Em.K, + updateCurrentStackVersion: Em.K, loadStackVersionsToModel: function () { - return {done: Em.K}; + return {done: Em.clb}; } }); @@ -459,6 +461,8 @@ describe('App.clusterController', function () { sinon.spy(upgradeController, 'initDBProperties'); sinon.spy(upgradeController, 'loadUpgradeData'); sinon.spy(upgradeController, 'loadStackVersionsToModel'); + sinon.spy(upgradeController, 'loadCompatibleVersions'); + sinon.spy(upgradeController, 'updateCurrentStackVersion'); sinon.stub(App.stackUpgradeHistoryMapper, 'map'); }); @@ -471,6 +475,8 @@ describe('App.clusterController', function () { upgradeController.initDBProperties.restore(); upgradeController.loadUpgradeData.restore(); upgradeController.loadStackVersionsToModel.restore(); + upgradeController.loadCompatibleVersions.restore(); + upgradeController.updateCurrentStackVersion.restore(); App.stackUpgradeHistoryMapper.map.restore(); }); @@ -503,6 +509,14 @@ describe('App.clusterController', function () { expect(upgradeController.loadStackVersionsToModel.calledWith(true)).to.be.true; }); + it('loadCompatibleVersions should be called', function () { + expect(upgradeController.loadCompatibleVersions.calledOnce).to.be.true; + }); + + it('updateCurrentStackVersion should be called', function () { + expect(upgradeController.updateCurrentStackVersion.calledOnce).to.be.true; + }); + it('initDBProperties is not called', function () { expect(upgradeController.initDBProperties.called).to.be.false; });
