Repository: ambari
Updated Branches:
  refs/heads/trunk 5fecb4e05 -> dd237dd8e


AMBARI-16113. JS error on delete config group on service configs page 
(onechiporenko)


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

Branch: refs/heads/trunk
Commit: dd237dd8ed10b938010e297a04fecf5f7cfce03f
Parents: 5fecb4e
Author: Oleg Nechiporenko <onechipore...@apache.org>
Authored: Tue Apr 26 11:47:19 2016 +0300
Committer: Oleg Nechiporenko <onechipore...@apache.org>
Committed: Wed Apr 27 10:51:54 2016 +0300

----------------------------------------------------------------------
 .../main/service/configs/config_overridable.js  |  3 +++
 .../step7/assign_master_controller_test.js      |  2 +-
 .../test/views/common/quick_link_view_test.js   | 28 ++++++++++++++------
 3 files changed, 24 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/dd237dd8/ambari-web/app/mixins/main/service/configs/config_overridable.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/main/service/configs/config_overridable.js 
b/ambari-web/app/mixins/main/service/configs/config_overridable.js
index ec2191f..cd161e4 100644
--- a/ambari-web/app/mixins/main/service/configs/config_overridable.js
+++ b/ambari-web/app/mixins/main/service/configs/config_overridable.js
@@ -402,6 +402,9 @@ App.ConfigOverridable = Em.Mixin.create({
       successFunction: function (data, xhr, params) {
         var groupFromModel = App.ServiceConfigGroup.find().findProperty('id', 
params.id);
         if (groupFromModel) {
+          if (groupFromModel.get('stateManager.currentState.name') !== 
'saved') {
+            groupFromModel.get('stateManager').transitionTo('loaded');
+          }
           App.configGroupsMapper.deleteRecord(groupFromModel);
         }
         if (successCallback) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/dd237dd8/ambari-web/test/controllers/wizard/step7/assign_master_controller_test.js
----------------------------------------------------------------------
diff --git 
a/ambari-web/test/controllers/wizard/step7/assign_master_controller_test.js 
b/ambari-web/test/controllers/wizard/step7/assign_master_controller_test.js
index 27fb7be..63fceb6 100644
--- a/ambari-web/test/controllers/wizard/step7/assign_master_controller_test.js
+++ b/ambari-web/test/controllers/wizard/step7/assign_master_controller_test.js
@@ -383,7 +383,7 @@ describe('App.AssignMasterOnStep7Controller', function () {
       expect(mock.saveMasterComponentHosts.calledOnce).to.be.true;
     });
 
-    it("saveMasterComponentHosts should be called", function() {
+    it("loadMasterComponentHosts should be called", 
function() {
       expect(mock.loadMasterComponentHosts.calledOnce).to.be.true;
     });
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/dd237dd8/ambari-web/test/views/common/quick_link_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/common/quick_link_view_test.js 
b/ambari-web/test/views/common/quick_link_view_test.js
index 6af100c..f9a52b1 100644
--- a/ambari-web/test/views/common/quick_link_view_test.js
+++ b/ambari-web/test/views/common/quick_link_view_test.js
@@ -1044,16 +1044,28 @@ describe('App.QuickViewLinks', function () {
       }
     ];
 
-    tests.forEach(function(_test){
-      var serviceName =_test.serviceName;
-      it(serviceName, function() {
-        var componentNames = App.QuickLinksConfig.find().findProperty('id', 
serviceName).get('links').mapProperty('component_name');
-        expect(quickViewLinks.getHosts({}, serviceName)).to.eql(_test.result 
|| ['host1']);
-        componentNames.forEach(function(_componentName){
-          expect(quickViewLinks.findHosts.calledWith(_componentName, 
{})).to.be.true;
+    tests.forEach(function (_test) {
+      var serviceName = _test.serviceName;
+      describe(serviceName, function () {
+        var componentNames;
+
+        beforeEach(function () {
+          componentNames = App.QuickLinksConfig.find().findProperty('id', 
serviceName).get('links').mapProperty('component_name');
+          this.result = quickViewLinks.getHosts({}, serviceName);
+        });
+
+        it('hosts', function () {
+          expect(this.result).to.be.eql(_test.result || ['host1']);
         });
+
+        it('components', function () {
+          
expect(quickViewLinks.findHosts.callCount).to.be.equal(componentNames.length);
+        });
+
         if (_test.callback) {
-          expect(quickViewLinks[_test.callback].calledOnce).to.be.true;
+          it('callback is called once', function () {
+            expect(quickViewLinks[_test.callback].calledOnce).to.be.true;
+          });
         }
       });
     });

Reply via email to