Fine-tune file protocol filter
This commit is contained in:
parent
06b0544bbe
commit
eec61f5289
3 changed files with 38 additions and 16 deletions
|
@ -34,12 +34,13 @@ describe('Protocol Filter', () => {
|
|||
expect(actual).to.equal(expected);
|
||||
});
|
||||
|
||||
it('returns proper file path for windows style file URI', () => {
|
||||
it('returns proper file path for file URI on windows', () => {
|
||||
const path =
|
||||
'file:///C:/Users/Someone/dev/desktop/background.html?name=Signal&locale=en&version=2.4.0';
|
||||
const expected = 'C:/Users/Someone/dev/desktop/background.html';
|
||||
const isWindows = true;
|
||||
|
||||
const actual = _urlToPath(path, { isWindows: true });
|
||||
const actual = _urlToPath(path, { isWindows });
|
||||
expect(actual).to.equal(expected);
|
||||
});
|
||||
|
||||
|
@ -72,6 +73,15 @@ describe('Protocol Filter', () => {
|
|||
expect(actual).to.equal(expected);
|
||||
});
|
||||
|
||||
it('handles SMB share path on windows', () => {
|
||||
const path = 'file://relative/path';
|
||||
const expected = 'elative/path';
|
||||
const isWindows = true;
|
||||
|
||||
const actual = _urlToPath(path, { isWindows });
|
||||
expect(actual).to.equal(expected);
|
||||
});
|
||||
|
||||
it('hands back a path with .. in it', () => {
|
||||
const path = 'file://../../..';
|
||||
const expected = '../../..';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue