|
@@ -1133,6 +1133,7 @@ describe('App.MainHostDetailsController', function () {
|
|
|
lastComponents: [],
|
|
|
masterComponents: [],
|
|
|
runningComponents: [],
|
|
|
+ notDecommissionedComponents: [],
|
|
|
nonDeletableComponents: [],
|
|
|
unknownComponents: []
|
|
|
};
|
|
@@ -1204,6 +1205,38 @@ describe('App.MainHostDetailsController', function () {
|
|
|
expect(controller.getHostComponentsInfo().runningComponents).to.eql(['ZK1']);
|
|
|
App.HostComponent.find.restore();
|
|
|
});
|
|
|
+ it('content.hostComponents has notDecommissioned running component', function () {
|
|
|
+ sinon.stub(App.HostComponent, 'find', function() {
|
|
|
+ return [{
|
|
|
+ id: 'DATANODE_host1',
|
|
|
+ componentName: 'DATANODE'
|
|
|
+ }];
|
|
|
+ });
|
|
|
+ controller.set('content', {hostComponents: [Em.Object.create({
|
|
|
+ componentName: 'DATANODE',
|
|
|
+ workStatus: 'STARTED',
|
|
|
+ displayName: 'DataNode',
|
|
|
+ adminState: 'INSERVICE'
|
|
|
+ })]});
|
|
|
+ expect(controller.getHostComponentsInfo().notDecommissionedComponents).to.eql(['DataNode']);
|
|
|
+ App.HostComponent.find.restore();
|
|
|
+ });
|
|
|
+ it('content.hostComponents has notDecommissioned running component', function () {
|
|
|
+ sinon.stub(App.HostComponent, 'find', function() {
|
|
|
+ return [{
|
|
|
+ id: 'DATANODE_host1',
|
|
|
+ componentName: 'DATANODE'
|
|
|
+ }];
|
|
|
+ });
|
|
|
+ controller.set('content', {hostComponents: [Em.Object.create({
|
|
|
+ componentName: 'DATANODE',
|
|
|
+ workStatus: 'INSTALLED',
|
|
|
+ displayName: 'DataNode',
|
|
|
+ adminState: 'INSERVICE'
|
|
|
+ })]});
|
|
|
+ expect(controller.getHostComponentsInfo().notDecommissionedComponents).to.eql(['DataNode']);
|
|
|
+ App.HostComponent.find.restore();
|
|
|
+ });
|
|
|
it('content.hostComponents has non-deletable component', function () {
|
|
|
sinon.stub(App.HostComponent, 'find', function() {
|
|
|
return [{
|
|
@@ -1277,7 +1310,8 @@ describe('App.MainHostDetailsController', function () {
|
|
|
controller.set('mockHostComponentsInfo', {
|
|
|
masterComponents: [],
|
|
|
nonDeletableComponents: [],
|
|
|
- runningComponents: [{}]
|
|
|
+ runningComponents: [{}],
|
|
|
+ notDecommissionedComponents: []
|
|
|
});
|
|
|
controller.validateAndDeleteHost();
|
|
|
expect(controller.raiseDeleteComponentsError.calledWith([{}], 'runningList')).to.be.true;
|
|
@@ -1287,6 +1321,7 @@ describe('App.MainHostDetailsController', function () {
|
|
|
masterComponents: [],
|
|
|
nonDeletableComponents: [],
|
|
|
runningComponents: [],
|
|
|
+ notDecommissionedComponents: [],
|
|
|
unknownComponents: [],
|
|
|
lastComponents: [],
|
|
|
zkServerInstalled: true
|
|
@@ -1301,6 +1336,7 @@ describe('App.MainHostDetailsController', function () {
|
|
|
masterComponents: [],
|
|
|
nonDeletableComponents: [],
|
|
|
runningComponents: [],
|
|
|
+ notDecommissionedComponents: [],
|
|
|
unknownComponents: [],
|
|
|
lastComponents: [],
|
|
|
zkServerInstalled: false
|