@@ -53,7 +53,7 @@ describe('Install controller', function() {
5353 describe ( 'constrution' , function ( ) {
5454 it ( 'should process all installables' , function ( ) {
5555 let stub = sandbox . stub ( InstallController . prototype , 'processInstallable' ) . returns ( ) ;
56- new InstallController ( { } , { } , installerDataSvc ) ;
56+ new InstallController ( { } , { } , installerDataSvc , new ElectronMock ( ) ) ;
5757
5858 expect ( stub ) . calledOnce ;
5959 expect ( stub ) . calledWith ( VirtualBoxInstall . KEY , vbox ) ;
@@ -63,7 +63,7 @@ describe('Install controller', function() {
6363 let stub = sandbox . stub ( installerDataSvc , 'setupDone' ) . returns ( ) ;
6464 sandbox . stub ( InstallController . prototype , 'processInstallable' ) . returns ( ) ;
6565 sandbox . stub ( vbox , 'isSkipped' ) . returns ( true ) ;
66- new InstallController ( { } , { } , installerDataSvc ) ;
66+ new InstallController ( { } , { } , installerDataSvc , new ElectronMock ( ) ) ;
6767 expect ( stub ) . calledOnce ;
6868 } ) ;
6969 } ) ;
@@ -87,14 +87,14 @@ describe('Install controller', function() {
8787 } ) ;
8888
8989 it ( 'should trigger download on not downloaded installables' , function ( ) {
90- new InstallController ( { } , timeoutStub , installerDataSvc ) ;
90+ new InstallController ( { } , timeoutStub , installerDataSvc , new ElectronMock ( ) ) ;
9191
9292 expect ( dlStub ) . calledOnce ;
9393 expect ( dlStub ) . calledWith ( 'virtualbox' , vbox ) ;
9494 } ) ;
9595
9696 it ( 'should not trigger download on already downloaded items' , function ( ) {
97- new InstallController ( { } , timeoutStub , installerDataSvc ) ;
97+ new InstallController ( { } , timeoutStub , installerDataSvc , new ElectronMock ( ) ) ;
9898
9999 } ) ;
100100 } ) ;
@@ -109,7 +109,7 @@ describe('Install controller', function() {
109109
110110 it ( 'data service should register the new downloads' , function ( ) {
111111 let spy = sandbox . spy ( installerDataSvc , 'startDownload' ) ;
112- new InstallController ( { } , timeoutStub , installerDataSvc ) ;
112+ new InstallController ( { } , timeoutStub , installerDataSvc , new ElectronMock ( ) ) ;
113113
114114 expect ( spy ) . calledOnce ;
115115 expect ( spy ) . calledWith ( 'virtualbox' ) ;
@@ -121,7 +121,7 @@ describe('Install controller', function() {
121121 it ( 'should call the installables downloadInstaller method' , function ( ) {
122122 sandbox . stub ( installerDataSvc , 'startDownload' ) . returns ( ) ;
123123
124- new InstallController ( { } , timeoutStub , installerDataSvc ) ;
124+ new InstallController ( { } , timeoutStub , installerDataSvc , new ElectronMock ( ) ) ;
125125 expect ( vboxStub ) . calledOnce ;
126126 } ) ;
127127 } ) ;
@@ -138,21 +138,21 @@ describe('Install controller', function() {
138138 it . skip ( 'logs error in case of install failed' , function ( ) {
139139 vbox . install . restore ( ) ;
140140 sandbox . stub ( vbox , 'install' ) . callsArgWith ( 2 , 'Error' ) ;
141- new InstallController ( { } , timeoutStub , installerDataSvc ) ;
141+ new InstallController ( { } , timeoutStub , installerDataSvc , new ElectronMock ( ) ) ;
142142 expect ( errorStub ) . calledTwice ;
143143 } ) ;
144144
145145 it . skip ( 'should call the installables install method' , function ( ) {
146146 sandbox . stub ( installerDataSvc , 'startInstall' ) . returns ( ) ;
147147
148- new InstallController ( { } , timeoutStub , installerDataSvc ) ;
148+ new InstallController ( { } , timeoutStub , installerDataSvc , new ElectronMock ( ) ) ;
149149 expect ( vboxStub ) . calledOnce ;
150150 } ) ;
151151
152152 it . skip ( 'should call data services installDone when install finishes' , function ( ) {
153153 sandbox . stub ( installerDataSvc , 'startInstall' ) . returns ( ) ;
154154
155- new InstallController ( { } , timeoutStub , installerDataSvc ) ;
155+ new InstallController ( { } , timeoutStub , installerDataSvc , new ElectronMock ( ) ) ;
156156
157157 expect ( doneStub ) . calledOnce ;
158158 expect ( doneStub ) . calledWith ( sinon . match . any , 'virtualbox' ) ;
@@ -173,18 +173,13 @@ describe('Install controller', function() {
173173 } ) ;
174174 } ) ;
175175 describe ( 'setCurrent' , function ( ) {
176- it ( 'should do nothing if new current progress value is the same' , function ( ) {
177- let progress = new ProgressState ( ) ;
178- progress . $timeout = sandbox . stub ( ) . yields ( ) ;
179- progress . setCurrent ( 0 ) ;
180- expect ( progress . $timeout ) . to . be . not . called ;
181- } ) ;
182176 describe ( 'should update' , function ( ) {
183177 let progress ;
184178 beforeEach ( function ( ) {
185179 progress = new ProgressState ( ) ;
186180 progress . $timeout = sinon . stub ( ) ;
187181 progress . $scope = { $apply :sinon . stub ( ) } ;
182+ progress . setStatus ( 'Downloading' ) ;
188183 progress . setTotalAmount ( 1000 ) ;
189184 progress . setCurrent ( 100 ) ;
190185 } ) ;
@@ -292,12 +287,6 @@ describe('Install controller', function() {
292287 it ( 'sets status to "Complete"' , function ( ) {
293288 expect ( progress . status ) . equals ( 'Complete' ) ;
294289 } ) ;
295- it ( 'sets label to 100%' , function ( ) {
296- expect ( progress . label ) . equals ( '' ) ;
297- } ) ;
298- it ( 'sets current prcentage to 100' , function ( ) {
299- expect ( progress . current ) . equals ( 100 ) ;
300- } ) ;
301290 } ) ;
302291 describe ( 'calculateTime' , function ( ) {
303292 let progress ;
0 commit comments