diff --git a/packages/xo-remote-parser/src/index.js b/packages/xo-remote-parser/src/index.js index f3abe614c..7fe07e7cd 100644 --- a/packages/xo-remote-parser/src/index.js +++ b/packages/xo-remote-parser/src/index.js @@ -10,7 +10,7 @@ export const parse = string => { const [type, rest] = string.split('://') if (type === 'file') { - object.type = 'local' + object.type = 'file' object.path = `/${trimStart(rest, '/')}` // the leading slash has been forgotten on client side first implementation } else if (type === 'nfs') { object.type = 'nfs' diff --git a/packages/xo-remote-parser/src/index.spec.js b/packages/xo-remote-parser/src/index.spec.js index 057f4286a..836d0115a 100644 --- a/packages/xo-remote-parser/src/index.spec.js +++ b/packages/xo-remote-parser/src/index.spec.js @@ -14,7 +14,7 @@ const data = deepFreeze({ file: { string: 'file:///var/lib/xoa/backup', object: { - type: 'local', + type: 'file', path: '/var/lib/xoa/backup' } }, @@ -37,13 +37,23 @@ const parseData = deepFreeze({ 'file with missing leading slash (#7)': { string: 'file://var/lib/xoa/backup', object: { - type: 'local', + type: 'file', path: '/var/lib/xoa/backup' } } }) -const formatData = data +const formatData = deepFreeze({ + ...data, + + 'file with local type': { + string: 'file:///var/lib/xoa/backup', + object: { + type: 'local', + path: '/var/lib/xoa/backup' + } + } +}) // -------------------------------------------------------------------