Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AMBARI-24760. Broken unit test in ambari-web/test/controllers/main/admin/highAvailability/journalNode/step3_controller_test.js #2440

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ App.ManageJournalNodeWizardStep3Controller = App.HighAvailabilityWizardStep4Cont
isDataLoadedAndNextEnabled: Em.computed.and('isNextEnabled', 'isHDFSNameSpacesLoaded'),

pullCheckPointsStatuses: function () {
console.log('isHDFSNameSpacesLoaded', this.get('isHDFSNameSpacesLoaded'));
if (this.get('isHDFSNameSpacesLoaded')) {
this.removeObserver('isHDFSNameSpacesLoaded', this, 'pullCheckPointsStatuses');
const hdfsModel = App.HDFSService.find('HDFS'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,16 @@ describe('App.ManageJournalNodeWizardStep3Controller', function () {
describe('#pullCheckPointsStatuses', function () {
it('should removeObserver if HDFS namespaces are loaded', function () {
controller.set('isHDFSNameSpacesLoaded', true);
console.log('isHDFSNameSpacesLoaded from test', controller.get('isHDFSNameSpacesLoaded'));
controller.set('content.masterComponentHosts', [{component: 'NAMENODE', isInstalled: true, hostName: 'test'}]);
sinon.stub(controller, 'addObserver');
sinon.stub(controller, 'removeObserver');
sinon.stub(App.HostComponent, 'find').returns([Em.Object.create({componentName: 'NAMENODE' })])
controller.pullCheckPointsStatuses();
expect(controller.addObserver.calledOnce).to.be.false;
//expect(controller.removeObserver.calledWith('isHDFSNameSpacesLoaded', controller, 'pullCheckPointsStatuses')).to.be.true;
expect(controller.removeObserver.calledWith('isHDFSNameSpacesLoaded', controller, 'pullCheckPointsStatuses')).to.be.true;
controller.addObserver.restore();
controller.removeObserver.restore();
App.HostComponent.find.restore();
});

it('should send ajax request if nameSpacesCount is more than 1', function () {
Expand Down