ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From onechipore...@apache.org
Subject ambari git commit: AMBARI-16925. Config pages are corrupted for services failed to install. (onechiporenko)
Date Mon, 30 May 2016 07:40:27 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 008e4d184 -> e12b8130d


AMBARI-16925. Config pages are corrupted for services failed to install. (onechiporenko)


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

Branch: refs/heads/trunk
Commit: e12b8130def42684ae5bf84721b3e7fa8e7db644
Parents: 008e4d1
Author: Oleg Nechiporenko <onechiporenko@apache.org>
Authored: Fri May 27 15:11:20 2016 +0300
Committer: Oleg Nechiporenko <onechiporenko@apache.org>
Committed: Mon May 30 10:37:52 2016 +0300

----------------------------------------------------------------------
 .../controllers/main/service/info/configs.js    | 34 ++++++++++----------
 .../app/mappers/configs/config_groups_mapper.js |  2 +-
 .../configs/service_config_version_mapper.js    |  2 +-
 .../app/mixins/common/configs/configs_loader.js | 12 +++----
 ambari-web/app/models/configs/config_group.js   |  5 ++-
 .../models/configs/service_config_version.js    |  4 +--
 .../views/common/configs/config_history_flow.js | 16 ++++-----
 .../common/configs/enhanced_configs_test.js     |  6 ++--
 .../test/models/configs/config_group_test.js    |  2 +-
 .../host_progress_popup_body_view_test.js       | 29 ++++++++---------
 10 files changed, 56 insertions(+), 56 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e12b8130/ambari-web/app/controllers/main/service/info/configs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/info/configs.js b/ambari-web/app/controllers/main/service/info/configs.js
index 91a0eef..fe6bd4b 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -216,7 +216,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ConfigsLoader,
A
       .get('configs')
       .filterProperty('displayType', 'password')
       .someProperty('isNotDefaultValue');
-  }.property('stepConfigs.[].configs', 'selectedService.serviceName'),
+  }.property('stepConfigs.@each.configs', 'selectedService.serviceName'),
 
   /**
    * indicate whether service config version belongs to default config group
@@ -226,7 +226,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ConfigsLoader,
A
    * @method isVersionDefault
    */
   isVersionDefault: function(version) {
-    return (App.ServiceConfigVersion.find(this.get('content.serviceName') + "_" + version).get('groupName')
=== 'default');
+    return App.ServiceConfigVersion.find(this.get('content.serviceName') + "_" + version).get('groupName')
=== App.ServiceConfigGroup.defaultGroupName;
   },
 
   /**
@@ -341,7 +341,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ConfigsLoader,
A
 
     var configs = [];
     data.items.forEach(function (version) {
-      if (version.group_name == 'default') {
+      if (version.group_name === App.ServiceConfigGroup.defaultGroupName) {
         version.configurations.forEach(function (configObject) {
           configs = configs.concat(App.config.getConfigsFromJSON(configObject, true));
         });
@@ -424,7 +424,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ConfigsLoader,
A
   addOverrides: function(data, allConfigs) {
     var self = this;
     data.items.forEach(function(group) {
-      if (group.group_name != 'default') {
+      if (group.group_name !== App.ServiceConfigGroup.defaultGroupName) {
         var configGroup = App.ServiceConfigGroup.find().filterProperty('serviceName', group.service_name).findProperty('name',
group.group_name);
         group.configurations.forEach(function(config) {
           for (var prop in config.properties) {
@@ -433,18 +433,18 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ConfigsLoader,
A
             if (serviceConfig) {
               var value = App.config.formatPropertyValue(serviceConfig, config.properties[prop]);
               var isFinal = !!(config.properties_attributes && config.properties_attributes.final
&& config.properties_attributes.final[prop]);
-              if (self.get('selectedConfigGroup.isDefault') || configGroup.get('name') ==
self.get('selectedConfigGroup.name')) {
+              if (self.get('selectedConfigGroup.isDefault') || configGroup.get('name') ===
self.get('selectedConfigGroup.name')) {
                 var overridePlainObject = {
                   "value": value,
                   "savedValue": value,
                   "isFinal": isFinal,
                   "savedIsFinal": isFinal,
-                  "isEditable": self.get('canEdit') && configGroup.get('name') ==
self.get('selectedConfigGroup.name')
+                  "isEditable": self.get('canEdit') && configGroup.get('name') ===
self.get('selectedConfigGroup.name')
                 };
                 App.config.createOverride(serviceConfig, overridePlainObject, configGroup);
               }
             } else {
-              var isEditable = self.get('canEdit') && configGroup.get('name') ==
self.get('selectedConfigGroup.name');
+              var isEditable = self.get('canEdit') && configGroup.get('name') ===
self.get('selectedConfigGroup.name');
               allConfigs.push(App.config.createCustomGroupConfig({
                 propertyName: prop,
                 filename: fileName,
@@ -466,7 +466,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ConfigsLoader,
A
    */
   onLoadOverrides: function (allConfigs) {
     this.get('servicesToLoad').forEach(function(serviceName) {
-      var configGroups = serviceName == this.get('content.serviceName') ? this.get('configGroups')
: this.get('dependentConfigGroups').filterProperty('serviceName', serviceName);
+      var configGroups = serviceName === this.get('content.serviceName') ? this.get('configGroups')
: this.get('dependentConfigGroups').filterProperty('serviceName', serviceName);
       var configTypes = App.StackService.find(serviceName).get('configTypeList');
       var configsByService = this.get('allConfigs').filter(function (c) {
         return configTypes.contains(App.config.getConfigTagFromFileName(c.get('filename')));
@@ -518,7 +518,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ConfigsLoader,
A
         var value = patternConfig.get('value') === true || ["yes", "true"].contains(patternConfig.get('value').toLowerCase());
 
         serviceConfig.configs.filter(function(c) {
-          if (c.get('category') === category && c.get('name').match(patternConfig.get('dependentConfigPattern'))
&& c.get('name') != patternConfig.get('name'))
+          if (c.get('category') === category && c.get('name').match(patternConfig.get('dependentConfigPattern'))
&& c.get('name') !== patternConfig.get('name'))
             c.set('isVisible', value);
         });
       }
@@ -548,7 +548,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ConfigsLoader,
A
     var value = !!this.get('overrideToAdd.widget') ? Em.get(overrideToAdd, 'value') : '';
     if (overrideToAdd) {
       overrideToAdd = stepConfig.configs.filter(function(c){
-        return c.name == overrideToAdd.name && c.filename == overrideToAdd.filename;
+        return c.name == overrideToAdd.name && c.filename === overrideToAdd.filename;
       });
       if (overrideToAdd[0]) {
         App.config.createOverride(overrideToAdd[0], {"isEditable": true, "value": value},
this.get('selectedConfigGroup'));
@@ -573,11 +573,11 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ConfigsLoader,
A
 
     App.ConfigAction.find().forEach(function(item){
       var hostComponentConfig = item.get('hostComponentConfig');
-      var config =  serviceConfig.get('configs').filterProperty('filename', hostComponentConfig.fileName).findProperty('name',
hostComponentConfig.configName);
+      var config = serviceConfig.get('configs').filterProperty('filename', hostComponentConfig.fileName).findProperty('name',
hostComponentConfig.configName);
       if (config){
         var componentHostName = App.HostComponent.find().findProperty('componentName', item.get('componentName'))
;
         if (componentHostName) {
-          var setConfigValue =  !config.get('value');
+          var setConfigValue = !config.get('value');
           if (setConfigValue) {
             config.set('value', componentHostName.get('hostName'));
             config.set('recommendedValue', componentHostName.get('hostName'));
@@ -627,11 +627,11 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ConfigsLoader,
A
     var restartRequiredHostsAndComponents = this.get('content.restartRequiredHostsAndComponents');
     for (var hostName in restartRequiredHostsAndComponents) {
       restartRequiredHostsAndComponents[hostName].forEach(function (hostComponent) {
-        if (hostComponent == 'NameNode')
+        if (hostComponent === 'NameNode')
          isNNAffected = true;
       })
     }
-    if (this.get('content.serviceName') == 'HDFS' && isNNAffected &&
+    if (this.get('content.serviceName') === 'HDFS' && isNNAffected &&
       this.get('content.hostComponents').filterProperty('componentName', 'NAMENODE').someProperty('workStatus',
App.HostComponentStatus.started)) {
       App.router.get('mainServiceItemController').checkNnLastCheckpointTime(function () {
         return App.showConfirmationFeedBackPopup(function (query) {
@@ -666,7 +666,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ConfigsLoader,
A
     for (var hostName in restartRequiredHostsAndComponents) {
       hosts.push(hostName);
     }
-    var hostsText = hosts.length == 1 ? Em.I18n.t('common.host') : Em.I18n.t('common.hosts');
+    var hostsText = hosts.length === 1 ? Em.I18n.t('common.host') : Em.I18n.t('common.hosts');
     hosts = hosts.join(', ');
     this.showItemsShouldBeRestarted(hosts, Em.I18n.t('service.service.config.restartService.shouldBeRestarted').format(hostsText));
   },
@@ -692,10 +692,10 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ConfigsLoader,
A
     }
     var componentsList = [];
     for (var obj in componentsObject) {
-      var componentDisplayName = (componentsObject[obj] > 1) ? obj + 's' : obj;
+      var componentDisplayName = componentsObject[obj] > 1 ? obj + 's' : obj;
       componentsList.push(componentsObject[obj] + ' ' + componentDisplayName);
     }
-    var componentsText = componentsList.length == 1 ? Em.I18n.t('common.component') : Em.I18n.t('common.components');
+    var componentsText = componentsList.length === 1 ? Em.I18n.t('common.component') : Em.I18n.t('common.components');
     hostsComponets = componentsList.join(', ');
     this.showItemsShouldBeRestarted(hostsComponets, Em.I18n.t('service.service.config.restartService.shouldBeRestarted').format(componentsText));
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/e12b8130/ambari-web/app/mappers/configs/config_groups_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/configs/config_groups_mapper.js b/ambari-web/app/mappers/configs/config_groups_mapper.js
index b389c6d..9346615 100644
--- a/ambari-web/app/mappers/configs/config_groups_mapper.js
+++ b/ambari-web/app/mappers/configs/config_groups_mapper.js
@@ -63,7 +63,7 @@ App.configGroupsMapper = App.QuickDataMapper.create({
 
       if (json && json.items) {
         json.items.forEach(function (configGroup) {
-          if (configGroup.group_name != 'default') {
+          if (configGroup.group_name !== App.ServiceConfigGroup.defaultGroupName) {
             if (mapFromVersions) {
               configGroup.id = App.ServiceConfigGroup.groupId(configGroup.service_name, configGroup.group_name);
             } else {

http://git-wip-us.apache.org/repos/asf/ambari/blob/e12b8130/ambari-web/app/mappers/configs/service_config_version_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/configs/service_config_version_mapper.js b/ambari-web/app/mappers/configs/service_config_version_mapper.js
index 780c368..68bf235 100644
--- a/ambari-web/app/mappers/configs/service_config_version_mapper.js
+++ b/ambari-web/app/mappers/configs/service_config_version_mapper.js
@@ -87,7 +87,7 @@ App.serviceConfigVersionsMapper = App.QuickDataMapper.create({
           defaultHostNames = defaultHostNames.without(serviceToHostMap[sName][i]);
         }
         var defVer = result.find(function(v) {
-          return v.is_current && v.group_name === 'default' && v.service_name
== sName;
+          return v.is_current && v.group_name === App.ServiceConfigGroup.defaultGroupName
&& v.service_name == sName;
         });
         if (defVer) {
           defVer.hosts = defaultHostNames;

http://git-wip-us.apache.org/repos/asf/ambari/blob/e12b8130/ambari-web/app/mixins/common/configs/configs_loader.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/configs/configs_loader.js b/ambari-web/app/mixins/common/configs/configs_loader.js
index 2cd6ea2..a4542b0 100644
--- a/ambari-web/app/mixins/common/configs/configs_loader.js
+++ b/ambari-web/app/mixins/common/configs/configs_loader.js
@@ -62,7 +62,7 @@ App.ConfigsLoader = Em.Mixin.create(App.GroupsMappingMixin, {
   loadServiceConfigVersionsSuccess: function (data) {
     if (Em.get(data, 'items.length')) {
       App.serviceConfigVersionsMapper.map(data);
-      var currentDefault = data.items.filterProperty('group_name', 'default').findProperty('is_current');
+      var currentDefault = data.items.filterProperty('group_name', App.ServiceConfigGroup.defaultGroupName).findProperty('is_current');
       if (currentDefault) {
         this.set('currentDefaultVersion', currentDefault.service_config_version);
       }
@@ -78,8 +78,8 @@ App.ConfigsLoader = Em.Mixin.create(App.GroupsMappingMixin, {
       var self = this;
       this.loadConfigGroups(this.get('servicesToLoad')).done(function() {
         var selectedGroup = App.ServiceConfigGroup.find().find(function(g) {
-          return g.get('serviceName') == preSelectedVersion.get('serviceName')
-            && (g.get('name') == preSelectedVersion.get('groupName') || (preSelectedVersion.get('groupName')
== 'default' && g.get('isDefault')));
+          return g.get('serviceName') === preSelectedVersion.get('serviceName')
+            && (g.get('name') === preSelectedVersion.get('groupName') || preSelectedVersion.get('groupName')
=== App.ServiceConfigGroup.defaultGroupName && g.get('isDefault'));
         });
         self.set('selectedConfigGroup', selectedGroup);
         self.loadSelectedVersion(preSelectedVersion.get('version'), selectedGroup);
@@ -145,8 +145,8 @@ App.ConfigsLoader = Em.Mixin.create(App.GroupsMappingMixin, {
       this.loadCurrentVersions();
     } else {
       //version of non-default group require properties from current version of default group
to correctly display page
-      var versions = (this.isVersionDefault(version)) ? [version] : [this.get('currentDefaultVersion'),
version];
-      switchToGroup = (this.isVersionDefault(version) && !switchToGroup) ? this.get('configGroups').findProperty('isDefault')
: switchToGroup;
+      var versions = this.isVersionDefault(version) ? [version] : [this.get('currentDefaultVersion'),
version];
+      switchToGroup = this.isVersionDefault(version) && !switchToGroup ? this.get('configGroups').findProperty('isDefault')
: switchToGroup;
 
       if (this.get('dataIsLoaded') && switchToGroup) {
         this.set('selectedConfigGroup', switchToGroup);
@@ -159,7 +159,7 @@ App.ConfigsLoader = Em.Mixin.create(App.GroupsMappingMixin, {
         data: {
           serviceName: this.get('content.serviceName'),
           serviceConfigVersions: versions,
-          additionalParams: this.get('dependentServiceNames.length') ? '|service_name.in('
+  this.get('dependentServiceNames') + ')&is_current=true' : ''
+          additionalParams: this.get('dependentServiceNames.length') ? '|service_name.in('
+ this.get('dependentServiceNames') + ')&is_current=true' : ''
         },
         success: 'loadSelectedVersionsSuccess'
       }));

http://git-wip-us.apache.org/repos/asf/ambari/blob/e12b8130/ambari-web/app/models/configs/config_group.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/configs/config_group.js b/ambari-web/app/models/configs/config_group.js
index 44e20d5..55ddaad 100644
--- a/ambari-web/app/models/configs/config_group.js
+++ b/ambari-web/app/models/configs/config_group.js
@@ -44,6 +44,7 @@ App.ServiceConfigGroup = DS.Model.extend({
    * @type {boolean}
    */
   isDefault: DS.attr('boolean', {defaultValue: false}),
+
   /**
    * this flag is used for installed services' config groups
    * if user make changes to them - mark this flag to true
@@ -151,13 +152,15 @@ App.ServiceConfigGroup = DS.Model.extend({
 App.ServiceConfigGroup.FIXTURES = [];
 
 App.ServiceConfigGroup.getParentConfigGroupId = function(serviceName) {
-  return App.ServiceConfigGroup.groupId(serviceName, 'default');
+  return App.ServiceConfigGroup.groupId(serviceName, 'Default');
 };
 
 App.ServiceConfigGroup.groupId = function(serviceName, groupName) {
   return serviceName + "_" + groupName;
 };
 
+App.ServiceConfigGroup.defaultGroupName = 'Default';
+
 /**
  * Delete all records with isTemporary:true
  * @method

http://git-wip-us.apache.org/repos/asf/ambari/blob/e12b8130/ambari-web/app/models/configs/service_config_version.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/configs/service_config_version.js b/ambari-web/app/models/configs/service_config_version.js
index 9b73fca..8722bb3 100644
--- a/ambari-web/app/models/configs/service_config_version.js
+++ b/ambari-web/app/models/configs/service_config_version.js
@@ -40,14 +40,14 @@ App.ServiceConfigVersion = DS.Model.extend({
   stackVersion: DS.attr('string'),
   isCompatible: DS.attr('boolean'),
   canBeMadeCurrent: Em.computed.and('isCompatible', '!isCurrent'),
-  isDefault: Em.computed.equal('groupName', 'default'),
+  isDefault: Em.computed.equal('groupName', 'Default'),
   currentTooltip: Em.computed.i18nFormat('dashboard.configHistory.table.current.tooltip',
'displayName', 'configGroupName'),
 
   /**
    * @type {string}
    */
   configGroupName: function () {
-    return this.get('isDefault') ? Em.I18n.t('common.default') : this.get('groupName');
+    return this.get('isDefault') ? App.ServiceConfigGroup.defaultGroupName : this.get('groupName');
   }.property('groupName','isDefault'),
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/e12b8130/ambari-web/app/views/common/configs/config_history_flow.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/config_history_flow.js b/ambari-web/app/views/common/configs/config_history_flow.js
index 3f76f74..ad2b1ab 100644
--- a/ambari-web/app/views/common/configs/config_history_flow.js
+++ b/ambari-web/app/views/common/configs/config_history_flow.js
@@ -82,7 +82,7 @@ App.ConfigHistoryFlowView = Em.View.extend({
   shortNotes: Em.computed.truncate('displayedServiceVersion.notes', 100, 100),
 
   serviceVersions: function () {
-    var groupName = this.get('controller.selectedConfigGroup.isDefault') ? 'default'
+    var groupName = this.get('controller.selectedConfigGroup.isDefault') ? App.ServiceConfigGroup.defaultGroupName
         : this.get('controller.selectedConfigGroup.name');
     var groupId = this.get('controller.selectedConfigGroup.id');
     var self = this;
@@ -92,7 +92,7 @@ App.ConfigHistoryFlowView = Em.View.extend({
     }, this);
 
     var serviceVersions = this.get('allServiceVersions').filter(function(s) {
-      return (s.get('groupId') === groupId) || s.get('groupName') == 'default';
+      return s.get('groupId') === groupId || s.get('groupName') === App.ServiceConfigGroup.defaultGroupName;
     });
 
     if (!serviceVersions.findProperty('isDisplayed')) {
@@ -118,7 +118,7 @@ App.ConfigHistoryFlowView = Em.View.extend({
    * service versions which in viewport and visible to user
    */
   visibleServiceVersion: function () {
-    return this.get('serviceVersions').slice(this.get('startIndex'), (this.get('startIndex')
+ this.VERSIONS_IN_FLOW));
+    return this.get('serviceVersions').slice(this.get('startIndex'), this.get('startIndex')
+ this.VERSIONS_IN_FLOW);
   }.property('startIndex', 'serviceVersions'),
 
   /**
@@ -222,7 +222,7 @@ App.ConfigHistoryFlowView = Em.View.extend({
       // display current in default group
       serviceVersions.forEach(function (serviceVersion, index) {
         // find current in default group
-        if (serviceVersion.get('isCurrent') && serviceVersion.get('groupName') ==
Em.I18n.t('dashboard.configHistory.table.configGroup.default')) {
+        if (serviceVersion.get('isCurrent') && serviceVersion.get('groupName') ===
App.ServiceConfigGroup.defaultGroupName) {
           serviceVersion.set('isDisplayed', true);
           currentIndex = index + 1;
         }
@@ -231,7 +231,7 @@ App.ConfigHistoryFlowView = Em.View.extend({
       // display current in selected group
       serviceVersions.forEach(function (serviceVersion, index) {
         // find current in selected group
-        if (serviceVersion.get('isCurrent') && serviceVersion.get('groupName') ==
selectedGroupName) {
+        if (serviceVersion.get('isCurrent') && serviceVersion.get('groupName') ===
selectedGroupName) {
           serviceVersion.set('isDisplayed', true);
           currentIndex = index + 1;
         }
@@ -240,7 +240,7 @@ App.ConfigHistoryFlowView = Em.View.extend({
       if (currentIndex == 0) {
         serviceVersions.forEach(function (serviceVersion, index) {
           // find current in default group
-          if (serviceVersion.get('isCurrent') && serviceVersion.get('groupName')
== Em.I18n.t('dashboard.configHistory.table.configGroup.default')) {
+          if (serviceVersion.get('isCurrent') && serviceVersion.get('groupName')
=== App.ServiceConfigGroup.defaultGroupName) {
             currentIndex = index + 1;
             serviceVersion.set('isDisplayed', true);
           }
@@ -262,9 +262,9 @@ App.ConfigHistoryFlowView = Em.View.extend({
   adjustFlowView: function () {
     var startIndex = this.get('startIndex');
     this.get('serviceVersions').forEach(function (serviceVersion, index) {
-      serviceVersion.set('first', (index === startIndex));
+      serviceVersion.set('first', index === startIndex);
     });
-    this.set('showLeftArrow', (startIndex !== 0));
+    this.set('showLeftArrow', startIndex !== 0);
     this.set('showRightArrow', (this.get('serviceVersions.length') > this.VERSIONS_IN_FLOW)
&& ((startIndex + this.VERSIONS_IN_FLOW) < this.get('serviceVersions.length')));
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/e12b8130/ambari-web/test/mixins/common/configs/enhanced_configs_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/mixins/common/configs/enhanced_configs_test.js b/ambari-web/test/mixins/common/configs/enhanced_configs_test.js
index 012c221..7f503b9 100644
--- a/ambari-web/test/mixins/common/configs/enhanced_configs_test.js
+++ b/ambari-web/test/mixins/common/configs/enhanced_configs_test.js
@@ -175,13 +175,13 @@ describe('App.EnhancedConfigsMixin', function() {
       this.mockedCallback = sinon.stub();
     });
 
-    it("shound call callback if changedConfigs is empty array", function() {
+    it("should call callback if changedConfigs is empty array", function() {
       mixinInstance.loadConfigRecommendations([], this.mockedCallback);
-      expect(App.ajax.send.calledOnce).to.be.false;
+      expect(testHelpers.findAjaxRequest('name', 'config.recommendations')).to.not.exist;
       expect(this.mockedCallback.calledOnce).to.be.true;
     });
 
-    it("shound call callback from ajax callback if changedConfigs is not empty", function()
{
+    it("should call callback from ajax callback if changedConfigs is not empty", function()
{
       mixinInstance.loadConfigRecommendations([{}], this.mockedCallback);
       var args = testHelpers.findAjaxRequest('name', 'config.recommendations');
       expect(args[0]).exists;

http://git-wip-us.apache.org/repos/asf/ambari/blob/e12b8130/ambari-web/test/models/configs/config_group_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/models/configs/config_group_test.js b/ambari-web/test/models/configs/config_group_test.js
index b9bc56b..1d254c3 100644
--- a/ambari-web/test/models/configs/config_group_test.js
+++ b/ambari-web/test/models/configs/config_group_test.js
@@ -133,7 +133,7 @@ describe('App.ServiceConfigGroup', function () {
 
     it("App.ServiceConfigGroup.groupId should be called", function () {
       App.ServiceConfigGroup.getParentConfigGroupId('S1');
-      expect(App.ServiceConfigGroup.groupId.calledWith('S1', 'default')).to.be.true;
+      expect(App.ServiceConfigGroup.groupId.calledWith('S1', 'Default')).to.be.true;
     });
   });
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/e12b8130/ambari-web/test/views/common/host_progress_popup_body_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/common/host_progress_popup_body_view_test.js b/ambari-web/test/views/common/host_progress_popup_body_view_test.js
index 5343dc9..16c7b4d 100644
--- a/ambari-web/test/views/common/host_progress_popup_body_view_test.js
+++ b/ambari-web/test/views/common/host_progress_popup_body_view_test.js
@@ -127,7 +127,7 @@ describe('App.HostProgressPopupBodyView', function () {
 
   describe('#preloadHostModel', function() {
     describe('When Log Search installed', function() {
-      var cases;
+
       beforeEach(function() {
         this.HostModelStub = sinon.stub(App.Host, 'find');
         this.isLogSearchInstalled = sinon.stub(view, 'get').withArgs('isLogSearchInstalled');
@@ -142,7 +142,7 @@ describe('App.HostProgressPopupBodyView', function () {
         App.router.get('updateController').updateLogging.restore();
       });
 
-      cases = [
+      [
         {
           hostName: 'host1',
           logSearchSupported: true,
@@ -218,10 +218,13 @@ describe('App.HostProgressPopupBodyView', function () {
           },
           m: 'Host is absent, log search not installed and supported'
         }
-      ];
+      ].forEach(function(test) {
+
+        it('hostInfoLoaded should be true on init', function() {
+          expect(Em.get(view, 'hostInfoLoaded')).to.be.true;
+        });
 
-      cases.forEach(function(test) {
-        describe(test.m, function() {
+        describe(test.m, function () {
 
           beforeEach(function () {
             this.HostModelStub.returns(test.hosts);
@@ -232,26 +235,20 @@ describe('App.HostProgressPopupBodyView', function () {
             } else {
               this.updateCtrlStub.returns($.Deferred().resolve().promise());
             }
-          });
-
-          it('hostInfoLoaded should be true on init', function () {
-            expect(Em.get(view, 'hostInfoLoaded')).to.be.true;
-          });
-
-          it('updateLogging call validation', function () {
             Em.set(view, 'hostInfoLoaded', false);
             view.preloadHostModel(test.hostName);
+          });
+
+          it('updateLogging call validation', function() {
             expect(App.router.get('updateController').updateLogging.called).to.be.equal(test.e.updateLoggingCalled);
           });
 
-          it('in result hostInfoLoaded should be always true', function () {
-            Em.set(view, 'hostInfoLoaded', false);
-            view.preloadHostModel(test.hostName);
+          it('in result hostInfoLoaded should be always true', function() {
             expect(Em.get(view, 'hostInfoLoaded')).to.be.true;
           });
 
         });
-      }, this);
+      });
     });
   });
 });


Mime
View raw message