diff options
author | Azul <azul@riseup.net> | 2020-06-18 11:55:53 +0300 |
---|---|---|
committer | Azul <azul@riseup.net> | 2020-08-11 16:44:33 +0300 |
commit | 611b799b81773cb53ce467eb0f8baa2b2dfb3778 (patch) | |
tree | 5d5eedebc8e4c0fb6738378ff0e36ebc9aebe698 /src/tests | |
parent | a188b74d3c11a0f10b16253d90a578787b30139c (diff) |
links with complete urls
This way they also work if the viewer was opened from other apps
than the file app.
Also move the `relPath` param into the fragment.
It is only used to remember the relative path
for generating the short markdown form from the link.
Signed-off-by: Azul <azul@riseup.net>
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/helpers/links.spec.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/tests/helpers/links.spec.js b/src/tests/helpers/links.spec.js index ece8dd715..a72072fd9 100644 --- a/src/tests/helpers/links.spec.js +++ b/src/tests/helpers/links.spec.js @@ -8,6 +8,8 @@ global.OC = { }), }, }, + config: {modRewriteWorking: true}, + webroot: '' } describe('Preparing href attributes for the DOM', () => { @@ -32,22 +34,22 @@ describe('Preparing href attributes for the DOM', () => { test('relative link with fileid', () => { expect(domHref({attrs: {href: 'otherfile?fileId=123'}})) - .toBe('?dir=/Wiki&openfile=123&relPath=otherfile') + .toBe('/apps/files/?dir=/Wiki&openfile=123#relPath=otherfile') }) test('relative path with ../', () => { expect(domHref({attrs: {href: '../other/otherfile?fileId=123'}})) - .toBe('?dir=/other&openfile=123&relPath=../other/otherfile') + .toBe('/apps/files/?dir=/other&openfile=123#relPath=../other/otherfile') }) test('absolute path', () => { expect(domHref({attrs: {href: '/other/otherfile?fileId=123'}})) - .toBe('?dir=/other&openfile=123&relPath=/other/otherfile') + .toBe('/apps/files/?dir=/other&openfile=123#relPath=/other/otherfile') }) test('absolute path', () => { expect(domHref({attrs: {href: '/otherfile?fileId=123'}})) - .toBe('?dir=/&openfile=123&relPath=/otherfile') + .toBe('/apps/files/?dir=/&openfile=123#relPath=/otherfile') }) }) @@ -69,7 +71,7 @@ describe('Extracting short urls from the DOM', () => { }) test('relative link with fileid', () => { - expect(parseHref(domStub('?dir=/other&openfile=123&relPath=../other/otherfile'))) + expect(parseHref(domStub('?dir=/other&openfile=123#relPath=../other/otherfile'))) .toBe('../other/otherfile?fileId=123') }) |