diff --git a/lib/gui/models/store.js b/lib/gui/models/store.js index f0d58b12..b6811809 100644 --- a/lib/gui/models/store.js +++ b/lib/gui/models/store.js @@ -123,7 +123,7 @@ const storeReducer = (state, action) => { throw new Error(`Invalid state percentage: ${action.data.percentage}`); } - if (!action.data.eta) { + if (!action.data.eta && action.data.eta !== 0) { throw new Error('Missing state eta'); } diff --git a/tests/gui/modules/image-writer.spec.js b/tests/gui/modules/image-writer.spec.js index 4d74b72e..3fbb4c97 100644 --- a/tests/gui/modules/image-writer.spec.js +++ b/tests/gui/modules/image-writer.spec.js @@ -138,6 +138,18 @@ describe('Browser: ImageWriter', function() { }).to.throw('Missing state eta'); }); + it('should not throw if eta is equal to zero', function() { + ImageWriterService.setFlashing(true); + m.chai.expect(function() { + ImageWriterService.setProgressState({ + type: 'write', + percentage: 50, + eta: 0, + speed: 100000000000 + }); + }).to.not.throw('Missing state eta'); + }); + it('should throw if eta is not a number', function() { ImageWriterService.setFlashing(true); m.chai.expect(function() {