ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nc...@apache.org
Subject [04/32] ambari git commit: AMBARI-18506 Ambari should present message if stack upgrade path is not available
Date Fri, 07 Oct 2016 19:14:01 GMT
AMBARI-18506 Ambari should present message if stack upgrade path is not available


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 269494849cad6d0a56dddaf52316e1d84b08d49f
Parents: 98ba7e0
Author: Andrii Tkach <atkach@apache.org>
Authored: Fri Sep 30 17:04:30 2016 +0300
Committer: Andrii Tkach <atkach@apache.org>
Committed: Tue Oct 4 17:11:46 2016 +0300

----------------------------------------------------------------------
 ambari-web/app/assets/test/tests.js             |  1 +
 .../main/admin/stack_and_upgrade_controller.js  | 45 +++++++++---
 .../app/mappers/repository_version_mapper.js    | 28 +++++++-
 ambari-web/app/messages.js                      |  1 +
 .../models/stack_version/repository_version.js  |  6 ++
 .../admin/stack_upgrade/upgrade_version_box.hbs |  2 +-
 .../stack_upgrade/upgrade_version_column.hbs    |  2 +-
 ambari-web/app/utils/ajax/ajax.js               |  5 ++
 .../stack_upgrade/upgrade_version_box_view.js   |  6 ++
 .../upgrade_version_column_view.js              |  6 +-
 .../admin/stack_and_upgrade_controller_test.js  | 74 +++++++++++++++++++-
 .../mappers/repository_version_mapper_test.js   | 46 ++++++++++++
 .../upgrade_version_box_view_test.js            | 23 ++++--
 13 files changed, 223 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/26949484/ambari-web/app/assets/test/tests.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/test/tests.js b/ambari-web/app/assets/test/tests.js
index 78c6196..92def58 100644
--- a/ambari-web/app/assets/test/tests.js
+++ b/ambari-web/app/assets/test/tests.js
@@ -148,6 +148,7 @@ var files = [
   'test/mappers/users_mapper_test',
   'test/mappers/stack_mapper_test',
   'test/mappers/stack_service_mapper_test',
+  'test/mappers/repository_version_mapper_test',
   'test/mappers/stack_upgrade_history_mapper_test',
   'test/mappers/configs/config_groups_mapper_test',
   'test/mappers/configs/service_config_version_mapper_test',

http://git-wip-us.apache.org/repos/asf/ambari/blob/26949484/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 bbf7523..56a7a61 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
@@ -241,8 +241,8 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage,
    * @type {String}
    */
   realRepoUrl: function () {
-    return App.get('apiPrefix') + App.get('stackVersionURL') +
-      '/compatible_repository_versions?fields=*,operating_systems/*,operating_systems/repositories/*';
+    return App.get('apiPrefix') + '/stacks?fields=versions/repository_versions/RepositoryVersions,'
+
+      'versions/repository_versions/operating_systems/*,versions/repository_versions/operating_systems/repositories/*';
   }.property('App.stackVersionURL'),
 
   /**
@@ -329,14 +329,16 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage,
     this.loadUpgradeData(true).done(function() {
       self.loadStackVersionsToModel(true).done(function () {
         self.loadRepoVersionsToModel().done(function() {
-          var currentVersion = App.StackVersion.find().findProperty('state', 'CURRENT');
-          if (currentVersion) {
-            self.set('currentVersion', {
-              repository_version: currentVersion.get('repositoryVersion.repositoryVersion'),
-              repository_name: currentVersion.get('repositoryVersion.displayName')
-            });
-          }
-          dfd.resolve();
+          self.loadCompatibleVersions().done(function() {
+            var currentVersion = App.StackVersion.find().findProperty('state', 'CURRENT');
+            if (currentVersion) {
+              self.set('currentVersion', {
+                repository_version: currentVersion.get('repositoryVersion.repositoryVersion'),
+                repository_name: currentVersion.get('repositoryVersion.displayName')
+              });
+            }
+            dfd.resolve();
+          });
         });
       });
     });
@@ -395,6 +397,29 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage,
     }
   },
 
+  loadCompatibleVersions: function() {
+    return App.ajax.send({
+      name: 'admin.upgrade.get_compatible_versions',
+      sender: this,
+      data: {
+        stackName: App.get('currentStackName'),
+        stackVersion: App.get('currentStackVersionNumber')
+      },
+      success: 'loadCompatibleVersionsSuccessCallback'
+    });
+  },
+
+  /**
+   *
+   * @param {object} data
+   */
+  loadCompatibleVersionsSuccessCallback: function(data) {
+    App.RepositoryVersion.find().forEach(function(repo) {
+      var version = repo.get('repositoryVersion');
+      repo.set('isCompatible', data.items.someProperty('CompatibleRepositoryVersions.repository_version',
version));
+    });
+  },
+
   /**
    * update data of Upgrade
    * @param {object} newData

http://git-wip-us.apache.org/repos/asf/ambari/blob/26949484/ambari-web/app/mappers/repository_version_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/repository_version_mapper.js b/ambari-web/app/mappers/repository_version_mapper.js
index 19ff672..48e460b 100644
--- a/ambari-web/app/mappers/repository_version_mapper.js
+++ b/ambari-web/app/mappers/repository_version_mapper.js
@@ -24,7 +24,7 @@ App.repoVersionMapper = App.QuickDataMapper.create({
   modelServices: App.ServiceSimple,
 
   modelRepoVersion: function (isCurrentStackOnly) {
-    var repoVersionsKey = isCurrentStackOnly ? 'RepositoryVersions' : 'CompatibleRepositoryVersions';
+    var repoVersionsKey = 'RepositoryVersions';
     return {
       id: repoVersionsKey + '.id',
       stack_version_id: repoVersionsKey + '.stackVersionId',
@@ -92,7 +92,11 @@ App.repoVersionMapper = App.QuickDataMapper.create({
     var resultOS = [];
     var resultRepo = [];
     var resultService = [];
-    var repoVersionsKey = isCurrentStackOnly ? 'RepositoryVersions' : 'CompatibleRepositoryVersions';
+    var repoVersionsKey = 'RepositoryVersions';
+
+    if (!isCurrentStackOnly) {
+      json = this.convertToRepoScheme(json);
+    }
 
     if (json && json.items) {
       json.items.forEach(function (item) {
@@ -153,5 +157,25 @@ App.repoVersionMapper = App.QuickDataMapper.create({
     App.store.loadMany(modelOperatingSystems, resultOS);
     App.store.loadMany(modelServices, resultService);
     App.store.loadMany(modelRepoVersions, resultRepoVersion);
+  },
+
+  /**
+   *
+   * @param {?object} json
+   * @returns {{items: Array}}
+   */
+  convertToRepoScheme: function(json) {
+    var extractedJson = {items: []};
+
+    if (json && json.items) {
+      json.items.forEach(function(stack) {
+        stack.versions.forEach(function(version) {
+          version.repository_versions.forEach(function(repoVersion) {
+            extractedJson.items.push(repoVersion);
+          }, this);
+        }, this);
+      }, this);
+    }
+    return extractedJson;
   }
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/26949484/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 1c53839..5eafad2 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1653,6 +1653,7 @@ Em.I18n.translations = {
 
   'admin.stackVersions.version.column.showDetails': "Show Details",
   'admin.stackVersions.version.column.showDetails.title': "Version Details",
+  'admin.stackVersions.version.noCompatible.tooltip': 'Directly upgrading to this version
is not supported.',
 
   'admin.stackVersions.hosts.popup.header.current': "Current",
   'admin.stackVersions.hosts.popup.header.installed': "Installed",

http://git-wip-us.apache.org/repos/asf/ambari/blob/26949484/ambari-web/app/models/stack_version/repository_version.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/stack_version/repository_version.js b/ambari-web/app/models/stack_version/repository_version.js
index 759470d..d5bc64d 100644
--- a/ambari-web/app/models/stack_version/repository_version.js
+++ b/ambari-web/app/models/stack_version/repository_version.js
@@ -41,6 +41,12 @@ App.RepositoryVersion = DS.Model.extend({
   defaultStatus: 'INIT',
 
   /**
+   * @type {boolean}
+   * @default false
+   */
+  isCompatible: false,
+
+  /**
    * @type {string}
    */
   status: Em.computed.firstNotBlank('stackVersion.state', 'defaultStatus'),

http://git-wip-us.apache.org/repos/asf/ambari/blob/26949484/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_version_box.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_version_box.hbs b/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_version_box.hbs
index dcc6944..72bce5c 100644
--- a/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_version_box.hbs
+++ b/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_version_box.hbs
@@ -35,7 +35,7 @@
 </p>
 
 
-<div {{bindAttr class="view.stateElement.isInstalling:installing :align-center :state"}}>
+<div {{bindAttr class="view.stateElement.isInstalling:installing :align-center :state
:repo-version-tooltip"}}>
   {{#if view.stateElement.isButton}}
     <button class="btn btn-primary"
       {{action runAction target="view"}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/26949484/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_version_column.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_version_column.hbs
b/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_version_column.hbs
index 0878733..52a42fc 100644
--- a/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_version_column.hbs
+++ b/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_version_column.hbs
@@ -27,7 +27,7 @@
 <p class="version-column-show-details">
   <a {{action openVersionBoxPopup target="view"}}>{{t admin.stackVersions.version.column.showDetails}}</a>
 </p>
-<div {{bindAttr class="view.stateElement.isInstalling:installing :align-center :state"}}>
+<div {{bindAttr class="view.stateElement.isInstalling:installing :align-center :state
:repo-version-tooltip"}}>
   {{#if view.stateElement.isButton}}
     <button class="btn btn-primary"
       {{action runAction target="view"}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/26949484/ambari-web/app/utils/ajax/ajax.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/ajax/ajax.js b/ambari-web/app/utils/ajax/ajax.js
index 7eb9c9e..a5eafef 100644
--- a/ambari-web/app/utils/ajax/ajax.js
+++ b/ambari-web/app/utils/ajax/ajax.js
@@ -1851,6 +1851,11 @@ var urls = {
     'mock': '/data/stack_versions/supported_upgrade_types.json'
   },
 
+  'admin.upgrade.get_compatible_versions': {
+    'real': '/stacks/{stackName}/versions/{stackVersion}/compatible_repository_versions?fields=CompatibleRepositoryVersions/repository_version&minimal_response=true',
+    'mock': '/data/stack_versions/supported_upgrade_types.json'
+  },
+
   'admin.kerberos_security.checks': {
     //TODO when api will be known
     'real': '',

http://git-wip-us.apache.org/repos/asf/ambari/blob/26949484/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
index 1e549cd..bf15f33 100644
--- a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
+++ b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
@@ -242,6 +242,7 @@ App.UpgradeVersionBoxView = Em.View.extend({
    */
   isDisabledOnInit: function() {
     return  this.get('controller.requestInProgress') ||
+            !this.get('content.isCompatible') ||
             (App.get('upgradeIsRunning') && !App.get('upgradeSuspended')) ||
             this.get('parentView.repoVersions').someProperty('status', 'INSTALLING');
   },
@@ -263,6 +264,11 @@ App.UpgradeVersionBoxView = Em.View.extend({
     App.tooltip($('.link-tooltip'), {title: Em.I18n.t('admin.stackVersions.version.linkTooltip')});
     App.tooltip($('.hosts-tooltip'));
     App.tooltip($('.out-of-sync-badge'), {title: Em.I18n.t('hosts.host.stackVersions.status.out_of_sync')});
+    if (!this.get('content.isCompatible')) {
+      App.tooltip(this.$(".repo-version-tooltip"), {
+        title: Em.I18n.t('admin.stackVersions.version.noCompatible.tooltip')
+      });
+    }
     Em.run.later(this, function () {
       if (this.get('state') !== 'inDOM') {
         return;

http://git-wip-us.apache.org/repos/asf/ambari/blob/26949484/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_column_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_column_view.js
b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_column_view.js
index 6290a5e..f6f86db 100644
--- a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_column_view.js
+++ b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_column_view.js
@@ -26,7 +26,11 @@ App.UpgradeVersionColumnView = App.UpgradeVersionBoxView.extend({
 
   didInsertElement: function () {
     App.tooltip($('.out-of-sync-badge'), {title: Em.I18n.t('hosts.host.stackVersions.status.out_of_sync')});
-
+    if (!this.get('content.isCompatible')) {
+      App.tooltip(this.$(".repo-version-tooltip"), {
+        title: Em.I18n.t('admin.stackVersions.version.noCompatible.tooltip')
+      });
+    }
     //set the width, height of each version colum dynamically
     var widthFactor = App.RepositoryVersion.find().get('length') > 3 ? 0.18: 0.31;
     $('.version-column').width($('.versions-slides').width() * widthFactor);

http://git-wip-us.apache.org/repos/asf/ambari/blob/26949484/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 feaeafc..12d0da3 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
@@ -37,15 +37,16 @@ describe('App.MainAdminStackAndUpgradeController', function() {
   describe("#realRepoUrl", function() {
     before(function () {
       this.mock = sinon.stub(App, 'get');
-      this.mock.withArgs('apiPrefix').returns('apiPrefix')
-        .withArgs('stackVersionURL').returns('stackVersionURL');
+      this.mock.withArgs('apiPrefix').returns('apiPrefix');
     });
     after(function () {
       this.mock.restore();
     });
     it("should be valid", function() {
+      var expected = 'apiPrefix/stacks?fields=versions/repository_versions/RepositoryVersions,'
+
+        'versions/repository_versions/operating_systems/*,versions/repository_versions/operating_systems/repositories/*';
       controller.propertyDidChange('realRepoUrl');
-      expect(controller.get('realRepoUrl')).to.equal('apiPrefixstackVersionURL/compatible_repository_versions?fields=*,operating_systems/*,operating_systems/repositories/*');
+      expect(controller.get('realRepoUrl')).to.equal(expected);
     });
   });
 
@@ -121,6 +122,9 @@ describe('App.MainAdminStackAndUpgradeController', function() {
       sinon.stub(controller, 'loadRepoVersionsToModel').returns({
         done: Em.clb
       });
+      sinon.stub(controller, 'loadCompatibleVersions').returns({
+        done: Em.clb
+      });
       sinon.stub(App.StackVersion, 'find').returns([Em.Object.create({
         state: 'CURRENT',
         repositoryVersion: {
@@ -134,6 +138,7 @@ describe('App.MainAdminStackAndUpgradeController', function() {
       controller.loadUpgradeData.restore();
       controller.loadStackVersionsToModel.restore();
       controller.loadRepoVersionsToModel.restore();
+      controller.loadCompatibleVersions.restore();
       App.StackVersion.find.restore();
     });
     it("loadUpgradeData called with valid arguments", function() {
@@ -145,6 +150,9 @@ describe('App.MainAdminStackAndUpgradeController', function() {
     it('loadRepoVersionsToModel called once', function () {
       expect(controller.loadRepoVersionsToModel.calledOnce).to.be.true;
     });
+    it('loadCompatibleVersions called once', function () {
+      expect(controller.loadCompatibleVersions.calledOnce).to.be.true;
+    });
     it('currentVersion is corrent', function () {
       expect(controller.get('currentVersion')).to.eql({
         "repository_version": "2.2",
@@ -3120,4 +3128,64 @@ describe('App.MainAdminStackAndUpgradeController', function() {
     });
   });
 
+  describe("#loadCompatibleVersions()", function () {
+
+    beforeEach(function() {
+      sinon.stub(App, 'get').returns('stack');
+    });
+
+    afterEach(function() {
+      App.get.restore();
+    });
+
+    it("App.ajax.send should be called", function() {
+      controller.loadCompatibleVersions();
+      var args = testHelpers.findAjaxRequest('name', 'admin.upgrade.get_compatible_versions');
+      expect(args[0]).to.be.eql({
+        name: 'admin.upgrade.get_compatible_versions',
+        sender: controller,
+        data: {
+          stackName: 'stack',
+          stackVersion: 'stack'
+        },
+        success: 'loadCompatibleVersionsSuccessCallback'
+      });
+    });
+  });
+
+  describe("#loadCompatibleVersionsSuccessCallback()", function () {
+    var mock = [
+      Em.Object.create({
+        repositoryVersion: 'HDP-1',
+        isCompatible: false
+      }),
+      Em.Object.create({
+        repositoryVersion: 'HDP-2',
+        isCompatible: false
+      })
+    ];
+
+    beforeEach(function() {
+      sinon.stub(App.RepositoryVersion, 'find').returns(mock);
+    });
+
+    afterEach(function() {
+      App.RepositoryVersion.find.restore();
+    });
+
+    it("should set isCompatible property", function() {
+      var data = {
+        items: [
+          {
+            CompatibleRepositoryVersions: {
+              repository_version: 'HDP-2'
+            }
+          }
+        ]
+      };
+      controller.loadCompatibleVersionsSuccessCallback(data);
+      expect(mock.mapProperty('isCompatible')).to.be.eql([false, true])
+    });
+  });
+
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/26949484/ambari-web/test/mappers/repository_version_mapper_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/mappers/repository_version_mapper_test.js b/ambari-web/test/mappers/repository_version_mapper_test.js
new file mode 100644
index 0000000..63fbb43
--- /dev/null
+++ b/ambari-web/test/mappers/repository_version_mapper_test.js
@@ -0,0 +1,46 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var App = require('app');
+
+require('utils/helper');
+require('mappers/repository_version_mapper');
+
+describe('App.repoVersionMapper', function () {
+
+  describe("#convertToRepoScheme()", function () {
+
+    it("json is null", function() {
+      expect(App.repoVersionMapper.convertToRepoScheme(null)).to.be.eql({items: []});
+    });
+
+    it("json is correct", function() {
+      var json = {
+        items: [{
+          versions: [{
+            repository_versions: [{
+              id: 1
+            }]
+          }]
+        }]
+      };
+      expect(App.repoVersionMapper.convertToRepoScheme(json)).to.be.eql({items: [{id: 1}]});
+    });
+  });
+
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/26949484/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js
b/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js
index d4114ed..4506d3a 100644
--- a/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js
+++ b/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js
@@ -141,7 +141,7 @@ describe('App.UpgradeVersionBoxView', function () {
     });
     it("init tooltips", function () {
       view.didInsertElement();
-      expect(App.tooltip.callCount).to.equal(3);
+      expect(App.tooltip.callCount).to.equal(4);
     });
   });
 
@@ -959,6 +959,7 @@ describe('App.UpgradeVersionBoxView', function () {
         upgradeIsRunning: true,
         upgradeSuspended: true,
         status: 'INSTALLED',
+        isCompatible: true,
         expected: true
       },
       {
@@ -966,6 +967,7 @@ describe('App.UpgradeVersionBoxView', function () {
         upgradeIsRunning: true,
         upgradeSuspended: false,
         status: 'INSTALLED',
+        isCompatible: true,
         expected: true
       },
       {
@@ -973,6 +975,7 @@ describe('App.UpgradeVersionBoxView', function () {
         upgradeIsRunning: false,
         upgradeSuspended: false,
         status: 'INSTALLING',
+        isCompatible: true,
         expected: true
       },
       {
@@ -980,6 +983,15 @@ describe('App.UpgradeVersionBoxView', function () {
         upgradeIsRunning: true,
         upgradeSuspended: true,
         status: 'INSTALLED',
+        isCompatible: false,
+        expected: true
+      },
+      {
+        requestInProgress: false,
+        upgradeIsRunning: true,
+        upgradeSuspended: true,
+        status: 'INSTALLED',
+        isCompatible: true,
         expected: false
       },
       {
@@ -987,6 +999,7 @@ describe('App.UpgradeVersionBoxView', function () {
         upgradeIsRunning: false,
         upgradeSuspended: false,
         status: 'INSTALLED',
+        isCompatible: true,
         expected: false
       }
     ];
@@ -1001,15 +1014,17 @@ describe('App.UpgradeVersionBoxView', function () {
 
     testCases.forEach(function(test) {
       it("requestInProgress: " + test.requestInProgress +
-         "upgradeIsRunning: " + test.upgradeIsRunning +
-         "upgradeSuspended: " + test.upgradeSuspended +
-         "status" + test.status, function() {
+         " upgradeIsRunning: " + test.upgradeIsRunning +
+         " upgradeSuspended: " + test.upgradeSuspended +
+         " status" + test.status +
+         " isCompatible" + test.isCompatible, function() {
         this.mock.withArgs('upgradeSuspended').returns(test.upgradeSuspended);
         this.mock.withArgs('upgradeIsRunning').returns(test.upgradeIsRunning);
         view.set('parentView.repoVersions', [Em.Object.create({
           status: test.status
         })]);
         view.set('controller.requestInProgress', test.requestInProgress);
+        view.set('content.isCompatible', test.isCompatible);
         expect(view.isDisabledOnInit()).to.be.equal(test.expected);
       });
     });


Mime
View raw message