Skip to content

Commit 3c932d4

Browse files
committed
Move loading the installable components to confirm page
Fix moves loading the list of components available for installation to confirmation controller in preparation to loading configuration from remote location.
1 parent ed99c7b commit 3c932d4

3 files changed

Lines changed: 8 additions & 9 deletions

File tree

browser/main.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,6 @@ let mainModule =
7474
displayName: 'Get Started'
7575
}
7676
});
77-
}])
78-
.run( ['installerDataSvc', (installerDataSvc) => {
79-
let loader = new ComponentLoader(installerDataSvc);
80-
loader.loadComponents();
8177
}]);
8278

8379
export default mainModule;

browser/pages/confirm/controller.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class ConfirmController {
1313
this.installerDataSvc = installerDataSvc;
1414
this.electron = electron;
1515
this.loader = new ComponentLoader(installerDataSvc);
16+
this.loader.loadComponents();
1617
this.installedSearchNote = '';
1718
this.isDisabled = false;
1819
this.numberOfExistingInstallations = 0;

test/unit/pages/confirm/controller-test.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import Logger from 'browser/services/logger';
77
import Platform from 'browser/services/platform';
88
import ElectronMock from '../../../mock/electron';
99
import ConfirmController from 'browser/pages/confirm/controller';
10+
1011
import fs from 'fs';
1112

1213
require('../../../angular-test-helper');
@@ -45,9 +46,7 @@ describe('ConfirmController', function() {
4546
sandbox.stub(fs, 'existsSync').returns(true);
4647
sandbox.spy(_$state_, 'go');
4748
installerDataSvc.setup();
48-
for (var installer of installerDataSvc.allInstallables().values()) {
49-
sandbox.stub(installer, 'detectExistingInstall').resolves();
50-
}
49+
5150
confirmController = $controller('ConfirmController', {
5251
$scope,
5352
$state: _$state_,
@@ -56,6 +55,9 @@ describe('ConfirmController', function() {
5655
electron
5756
});
5857
sandbox.spy(confirmController, 'setIsDisabled');
58+
for (let installer of installerDataSvc.allInstallables().values()) {
59+
sandbox.stub(installer, 'detectExistingInstall').resolves();
60+
}
5961
};
6062

6163
describe('initial state', function() {
@@ -157,7 +159,7 @@ describe('ConfirmController', function() {
157159
});
158160
beforeEach(inject(context));
159161
it('should deselect openjdk if jbosseap and devstudio are not selected', function() {
160-
debugger;
162+
161163
return confirmController.initPage().then(function() {
162164
expect(confirmController.sc.checkboxModel.jdk.selectedOption).equals('install');
163165
$watch.args.forEach(function(el) {
@@ -211,7 +213,7 @@ describe('ConfirmController', function() {
211213
$watch.args.forEach(function(el) {
212214
if(el[1].name == 'watchComponent'
213215
&& el[0] == 'checkboxModel.devstudio.selectedOption') {
214-
el[1]('install','detected');
216+
el[1]('install', 'detected');
215217
}
216218
});
217219
expect(confirmController.sc.checkboxModel.jdk.selectedOption).equals('install');

0 commit comments

Comments
 (0)