mirror of
https://github.com/balena-io/etcher.git
synced 2025-04-24 23:37:18 +00:00

- Rename `Etcher.Utils.Dropzone` to `Etcher.OS.Dropzone` - Rename `Etcher.Utils.OpenExternal` to `Etcher.OS.OpenExternal` - Rename `Etcher.Utils.WindowProgress` to `Etcher.OS.WindowProgress` - Rename `Etcher.notification` to `Etcher.OS.Notification` - Rename `Etcher.notifier` to `Etcher.Utils.Notifier` - Rename `Etcher.path` to `Etcher.Utils.Path` Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
36 lines
831 B
JavaScript
36 lines
831 B
JavaScript
'use strict';
|
|
|
|
const m = require('mochainon');
|
|
const angular = require('angular');
|
|
const os = require('os');
|
|
require('angular-mocks');
|
|
require('../../../lib/browser/utils/path/path');
|
|
|
|
describe('Browser: Path', function() {
|
|
|
|
beforeEach(angular.mock.module('Etcher.Utils.Path'));
|
|
|
|
describe('BasenameFilter', function() {
|
|
|
|
let basenameFilter;
|
|
|
|
beforeEach(angular.mock.inject(function(_basenameFilter_) {
|
|
basenameFilter = _basenameFilter_;
|
|
}));
|
|
|
|
it('should return the basename', function() {
|
|
const isWindows = os.platform() === 'win32';
|
|
let basename;
|
|
|
|
if (isWindows) {
|
|
basename = basenameFilter('C:\\Users\\jviotti\\foo.img');
|
|
} else {
|
|
basename = basenameFilter('/Users/jviotti/foo.img');
|
|
}
|
|
|
|
m.chai.expect(basename).to.equal('foo.img');
|
|
});
|
|
|
|
});
|
|
});
|