diff --git a/lib/gui/pages/main/controllers/main.js b/lib/gui/pages/main/controllers/main.js index cef2cd6b..97b4adfe 100644 --- a/lib/gui/pages/main/controllers/main.js +++ b/lib/gui/pages/main/controllers/main.js @@ -75,11 +75,11 @@ module.exports = function( * @returns {Boolean} whether the flash step should be disabled * * @example - * if (MainController.shouldFlashStateBeDisabled()) { + * if (MainController.shouldFlashStepBeDisabled()) { * console.log('The flash step should be disabled'); * } */ - this.shouldFlashStateBeDisabled = () => { + this.shouldFlashStepBeDisabled = () => { return this.shouldDriveStepBeDisabled() || !SelectionStateModel.hasDrive(); }; diff --git a/lib/gui/pages/main/templates/main.tpl.html b/lib/gui/pages/main/templates/main.tpl.html index 53fc12f1..bcf2b070 100644 --- a/lib/gui/pages/main/templates/main.tpl.html +++ b/lib/gui/pages/main/templates/main.tpl.html @@ -58,7 +58,7 @@
-
+
+ ng-disabled="main.shouldFlashStepBeDisabled()"> FLASH IMAGE + ng-disabled="main.shouldFlashStepBeDisabled()">FLASH IMAGE - 3 + 3
+ ng-disabled="main.shouldFlashStepBeDisabled()"> diff --git a/tests/gui/pages/main.spec.js b/tests/gui/pages/main.spec.js index ecf28aa5..d93ce3e3 100644 --- a/tests/gui/pages/main.spec.js +++ b/tests/gui/pages/main.spec.js @@ -49,7 +49,7 @@ describe('Browser: MainPage', function() { }); - describe('.shouldFlashStateBeDisabled()', function() { + describe('.shouldFlashStepBeDisabled()', function() { it('should return true if there is no selected drive nor image', function() { const controller = $controller('MainController', { @@ -58,7 +58,7 @@ describe('Browser: MainPage', function() { SelectionStateModel.clear(); - m.chai.expect(controller.shouldFlashStateBeDisabled()).to.be.true; + m.chai.expect(controller.shouldFlashStepBeDisabled()).to.be.true; }); it('should return true if there is a selected image but no drive', function() { @@ -72,7 +72,7 @@ describe('Browser: MainPage', function() { size: 99999 }); - m.chai.expect(controller.shouldFlashStateBeDisabled()).to.be.true; + m.chai.expect(controller.shouldFlashStepBeDisabled()).to.be.true; }); it('should return true if there is a selected drive but no image', function() { @@ -93,7 +93,7 @@ describe('Browser: MainPage', function() { SelectionStateModel.clear(); SelectionStateModel.setDrive('/dev/disk2'); - m.chai.expect(controller.shouldFlashStateBeDisabled()).to.be.true; + m.chai.expect(controller.shouldFlashStepBeDisabled()).to.be.true; }); it('should return false if there is a selected drive and a selected image', function() { @@ -119,7 +119,7 @@ describe('Browser: MainPage', function() { size: 99999 }); - m.chai.expect(controller.shouldFlashStateBeDisabled()).to.be.false; + m.chai.expect(controller.shouldFlashStepBeDisabled()).to.be.false; }); });