diff --git a/lib/gui/app/models/flash-state.js b/lib/gui/app/models/flash-state.js index 9c28ce1e..493d95dc 100644 --- a/lib/gui/app/models/flash-state.js +++ b/lib/gui/app/models/flash-state.js @@ -119,7 +119,8 @@ exports.setProgressState = (state) => { const data = _.assign({}, state, { percentage: _.isFinite(state.percentage) ? Math.floor(state.percentage) - : state.percentage, + // eslint-disable-next-line no-undefined + : undefined, speed: _.attempt(() => { if (_.isFinite(state.speed)) { diff --git a/tests/gui/models/flash-state.spec.js b/tests/gui/models/flash-state.spec.js index db35c667..d8229d6e 100644 --- a/tests/gui/models/flash-state.spec.js +++ b/tests/gui/models/flash-state.spec.js @@ -126,23 +126,6 @@ describe('Model: flashState', function () { }).to.not.throw('Missing flash fields: percentage') }) - it('should throw if percentage is not a number', function () { - flashState.setFlashingFlag() - m.chai.expect(function () { - flashState.setProgressState({ - flashing: 2, - verifying: 0, - successful: 0, - failed: 0, - type: 'write', - percentage: '50', - eta: 15, - speed: 100000000000, - totalSpeed: 200000000000 - }) - }).to.throw('Invalid state percentage: 50') - }) - it('should throw if percentage is outside maximum bound', function () { flashState.setFlashingFlag() m.chai.expect(function () {