Exemplo n.º 1
0
 it('should throw if given a percentage higher than 100', function() {
   m.chai.expect(function() {
     OSWindowProgressService.set(101);
   }).to.throw('Invalid window progress percentage: 101');
 });
Exemplo n.º 2
0
 it('should return the extension if there is only one extension', function () {
   m.chai.expect(fileExtensions.getLastFileExtension('foo.img')).to.equal('img')
 })
Exemplo n.º 3
0
 it('should return undefined in the file path has no extension', function () {
   m.chai.expect(fileExtensions.getPenultimateFileExtension('foo')).to.equal(null)
 })
Exemplo n.º 4
0
 it('should return the drive', function() {
   const drive = SelectionStateModel.getDrive();
   m.chai.expect(drive).to.equal('/dev/disk2');
 });
Exemplo n.º 5
0
 it('should override the drive', function() {
   SelectionStateModel.setDrive('/dev/disk5');
   const drive = SelectionStateModel.getDrive();
   m.chai.expect(drive).to.equal('/dev/disk5');
 });
Exemplo n.º 6
0
 it('should return false if an empty object is passed', function() {
   m.chai.expect(SelectionStateModel.isCurrentDrive({})).to.be.false;
 });
Exemplo n.º 7
0
 it('hasImage() should return false', function() {
   const hasImage = SelectionStateModel.hasImage();
   m.chai.expect(hasImage).to.be.false;
 });
Exemplo n.º 8
0
 it('should return false if no selected drive', function() {
   SelectionStateModel.removeDrive();
   const hasDrive = DriveSelectorStateService.hasSelectedDrive();
   m.chai.expect(hasDrive).to.be.false;
 });
Exemplo n.º 9
0
 it('should return false if the selected drive is an empty object', function() {
   SelectionStateModel.setDrive({});
   const hasDrive = DriveSelectorStateService.hasSelectedDrive();
   m.chai.expect(hasDrive).to.be.false;
 });
Exemplo n.º 10
0
 it('should return undefined if no selected drive', function() {
   SelectionStateModel.removeDrive();
   const drive = DriveSelectorStateService.getSelectedDrive();
   m.chai.expect(drive).to.not.exist;
 });
Exemplo n.º 11
0
 it('should return undefined if the selected drive is an empty object', function() {
   SelectionStateModel.setDrive({});
   const drive = DriveSelectorStateService.getSelectedDrive();
   m.chai.expect(drive).to.not.exist;
 });
Exemplo n.º 12
0
 it('should return false if there is no selected drive and an empty object is passed', function() {
   SelectionStateModel.removeDrive();
   m.chai.expect(DriveSelectorStateService.isSelectedDrive({})).to.be.false;
 });
Exemplo n.º 13
0
 it('should set -1', function() {
   OSWindowProgressService.clear();
   m.chai.expect(this.setProgressBarSpy).to.have.been.calledWith(-1);
 });
Exemplo n.º 14
0
 it('should throw if given a percentage less than 0', function() {
   m.chai.expect(function() {
     OSWindowProgressService.set(-1);
   }).to.throw('Invalid window progress percentage: -1');
 });
Exemplo n.º 15
0
 it('getImage() should return undefined', function() {
   const image = SelectionStateModel.getImage();
   m.chai.expect(image).to.be.undefined;
 });
Exemplo n.º 16
0
 $rootScope.onDropZone = function(file) {
   m.chai.expect(file).to.equal('/foo/bar');
   done();
 };
Exemplo n.º 17
0
 it('should return false if an undefined value is passed', function() {
   m.chai.expect(SelectionStateModel.isCurrentDrive()).to.be.false;
 });
Exemplo n.º 18
0
 $rootScope.onDropZone = function(file) {
   m.chai.expect(file).to.be.undefined;
   done();
 };
Exemplo n.º 19
0
 it('should be able to remove the drive', function() {
   m.chai.expect(SelectionStateModel.hasDrive()).to.be.true;
   SelectionStateModel.toggleSetDrive(this.drive);
   m.chai.expect(SelectionStateModel.hasDrive()).to.be.false;
 });
Exemplo n.º 20
0
 it('should clear the drive', function() {
   SelectionStateModel.removeDrive();
   const drive = SelectionStateModel.getDrive();
   m.chai.expect(drive).to.be.undefined;
 });
Exemplo n.º 21
0
 it('should return undefined', function() {
   const drive = SelectionStateModel.getDrive();
   m.chai.expect(drive).to.be.undefined;
 });
Exemplo n.º 22
0
 it('should override the image', function() {
   SelectionStateModel.setImage('bar.img');
   const image = SelectionStateModel.getImage();
   m.chai.expect(image).to.equal('bar.img');
 });
Exemplo n.º 23
0
 it('should return true', function() {
   const hasDrive = SelectionStateModel.hasDrive();
   m.chai.expect(hasDrive).to.be.true;
 });
Exemplo n.º 24
0
 it('should clear the image', function() {
   SelectionStateModel.removeImage();
   const image = SelectionStateModel.getImage();
   m.chai.expect(image).to.be.undefined;
 });
Exemplo n.º 25
0
 it('should set the element cursor to pointer', function() {
   const element = $compile('<span open-external="https://resin.io">Resin.io</span>')($rootScope);
   $rootScope.$digest();
   m.chai.expect(element.css('cursor')).to.equal('pointer');
 });
Exemplo n.º 26
0
 it('should be able to set an image', function() {
   SelectionStateModel.setImage('foo.img');
   const image = SelectionStateModel.getImage();
   m.chai.expect(image).to.equal('foo.img');
 });
Exemplo n.º 27
0
 it('should return the last extension if there are three extensions', function () {
   m.chai.expect(fileExtensions.getLastFileExtension('foo.bar.img.gz')).to.equal('gz')
 })
Exemplo n.º 28
0
 it('getImage() should return the image', function() {
   const image = SelectionStateModel.getImage();
   m.chai.expect(image).to.equal('foo.img');
 });
Exemplo n.º 29
0
 it('should return undefined if there is only one extension', function () {
   m.chai.expect(fileExtensions.getPenultimateFileExtension('foo.img')).to.equal(null)
 })
Exemplo n.º 30
0
 it('should set 1 given 100', function() {
   OSWindowProgressService.set(100);
   m.chai.expect(this.setProgressBarSpy).to.have.been.calledWith(1);
 });