mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-24 19:56:37 +00:00
Implement removeDrive and removeImage in selection service
This commit is contained in:
parent
ffbccc5aec
commit
b3dde83083
@ -669,6 +669,30 @@ selectionState.service('SelectionStateService', function() {
|
|||||||
return !!self.getImage();
|
return !!self.getImage();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @summary Remove drive
|
||||||
|
* @function
|
||||||
|
* @public
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* SelectionStateService.removeDrive();
|
||||||
|
*/
|
||||||
|
this.removeDrive = function() {
|
||||||
|
self.setDrive(undefined);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @summary Remove image
|
||||||
|
* @function
|
||||||
|
* @public
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* SelectionStateService.removeImage();
|
||||||
|
*/
|
||||||
|
this.removeImage = function() {
|
||||||
|
self.setImage(undefined);
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @summary Clear all selections
|
* @summary Clear all selections
|
||||||
* @function
|
* @function
|
||||||
|
@ -123,6 +123,30 @@ selectionState.service('SelectionStateService', function() {
|
|||||||
return !!self.getImage();
|
return !!self.getImage();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @summary Remove drive
|
||||||
|
* @function
|
||||||
|
* @public
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* SelectionStateService.removeDrive();
|
||||||
|
*/
|
||||||
|
this.removeDrive = function() {
|
||||||
|
self.setDrive(undefined);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @summary Remove image
|
||||||
|
* @function
|
||||||
|
* @public
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* SelectionStateService.removeImage();
|
||||||
|
*/
|
||||||
|
this.removeImage = function() {
|
||||||
|
self.setImage(undefined);
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @summary Clear all selections
|
* @summary Clear all selections
|
||||||
* @function
|
* @function
|
||||||
|
@ -78,6 +78,17 @@ describe('Browser: SelectionState', function() {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('.removeDrive()', function() {
|
||||||
|
|
||||||
|
it('should clear the drive', function() {
|
||||||
|
SelectionStateService.removeDrive();
|
||||||
|
var drive = SelectionStateService.getDrive();
|
||||||
|
m.chai.expect(drive).to.be.undefined;
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('given no drive', function() {
|
describe('given no drive', function() {
|
||||||
@ -128,6 +139,16 @@ describe('Browser: SelectionState', function() {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('.removeImage()', function() {
|
||||||
|
|
||||||
|
it('should clear the image', function() {
|
||||||
|
SelectionStateService.removeImage();
|
||||||
|
var image = SelectionStateService.getImage();
|
||||||
|
m.chai.expect(image).to.be.undefined;
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('given no image', function() {
|
describe('given no image', function() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user