etcher/tests/browser/utils/path.spec.js
Juan Cruz Viotti 42db5992fa Reorganize utilities and desktop integration modules (#316)
- 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>
2016-04-13 13:34:31 -04:00

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');
});
});
});