Skip to content

Commit

Permalink
Merge pull request #793 from kesselb/revert-789-encode-hashtag
Browse files Browse the repository at this point in the history
  • Loading branch information
skjnldsv authored Oct 3, 2023
2 parents d3ae6ca + 4ca1301 commit f02fb42
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 125 deletions.
14 changes: 0 additions & 14 deletions __tests__/dav/dav.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ describe('davResultToNode', () => {
expect(node.basename).toBe(result.basename)
expect(node.extension).toBe('.md')
expect(node.source).toBe('https://localhost/dav/files/test/New folder/Neue Textdatei.md')
expect(node.encodedSource).toBe('https://localhost/dav/files/test/New%20folder/Neue%20Textdatei.md')
expect(node.root).toBe(davRootPath)
expect(node.path).toBe('/New folder/Neue Textdatei.md')
expect(node.dirname).toBe('/New folder')
Expand All @@ -66,7 +65,6 @@ describe('davResultToNode', () => {
expect(node.extension).toBe('.md')
expect(node.root).toBe('/root')
expect(node.source).toBe('https://localhost/dav/root/New folder/Neue Textdatei.md')
expect(node.encodedSource).toBe('https://localhost/dav/root/New%20folder/Neue%20Textdatei.md')
expect(node.path).toBe('/New folder/Neue Textdatei.md')
expect(node.dirname).toBe('/New folder')
})
Expand All @@ -77,21 +75,9 @@ describe('davResultToNode', () => {
expect(node.basename).toBe(remoteResult.basename)
expect(node.extension).toBe('.md')
expect(node.source).toBe('http://example.com/dav/root/New folder/Neue Textdatei.md')
expect(node.encodedSource).toBe('http://example.com/dav/root/New%20folder/Neue%20Textdatei.md')
expect(node.path).toBe('/New folder/Neue Textdatei.md')
expect(node.dirname).toBe('/New folder')
})

test('encode special characters', () => {
const remoteResult = { ...result, basename: 'realy #1\'s.md', filename: '/root/~⛰️ shot of a $[big} mountain/realy #1\'s.md' }
const node = davResultToNode(remoteResult, '/root', 'http://example.com/dav')
expect(node.basename).toBe(remoteResult.basename)
expect(node.extension).toBe('.md')
expect(node.source).toBe('http://example.com/dav/root/~⛰️ shot of a $[big} mountain/realy #1\'s.md')
expect(node.encodedSource).toBe('http://example.com/dav/root/~%E2%9B%B0%EF%B8%8F%20shot%20of%20a%20%24%5Bbig%7D%20mountain/realy%20%231\'s.md')
expect(node.path).toBe('/~⛰️ shot of a $[big} mountain/realy #1\'s.md')
expect(node.dirname).toBe('/~⛰️ shot of a $[big} mountain')
})
})

describe('DAV requests', () => {
Expand Down
12 changes: 0 additions & 12 deletions __tests__/files/file.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ describe('File creation', () => {
test('Valid dav file', () => {
const file = new File({
source: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg',
encodedSource: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg',
mime: 'image/jpeg',
owner: 'emma',
mtime: new Date(Date.UTC(2023, 0, 1, 0, 0, 0)),
Expand Down Expand Up @@ -44,7 +43,6 @@ describe('File creation', () => {
test('Valid dav file with root', () => {
const file = new File({
source: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg',
encodedSource: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg',
mime: 'image/jpeg',
owner: 'emma',
root: '/files/emma',
Expand Down Expand Up @@ -72,7 +70,6 @@ describe('File creation', () => {
test('Valid remote file', () => {
const file = new File({
source: 'https://domain.com/Photos/picture.jpg',
encodedSource: 'https://domain.com/Photos/picture.jpg',
mime: 'image/jpeg',
owner: null,
})
Expand Down Expand Up @@ -100,7 +97,6 @@ describe('File data change', () => {
test('Rename a file', () => {
const file = new File({
source: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg',
encodedSource: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg',
mime: 'image/jpeg',
owner: 'emma',
mtime: new Date(Date.UTC(2023, 0, 1, 0, 0, 0)),
Expand All @@ -125,7 +121,6 @@ describe('File data change', () => {
test('Moving a file', () => {
const file = new File({
source: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg',
encodedSource: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg',
mime: 'image/jpeg',
owner: 'emma',
mtime: new Date(Date.UTC(2023, 0, 1, 0, 0, 0)),
Expand All @@ -150,7 +145,6 @@ describe('File data change', () => {
test('Moving a file to an invalid destination throws', () => {
const file = new File({
source: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg',
encodedSource: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg',
mime: 'image/jpeg',
owner: 'emma',
mtime: new Date(Date.UTC(2023, 0, 1, 0, 0, 0)),
Expand All @@ -163,7 +157,6 @@ describe('File data change', () => {
test('Moving a file to a different folder with root', () => {
const file = new File({
source: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg',
encodedSource: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg',
mime: 'image/jpeg',
owner: 'emma',
root: '/files/emma',
Expand All @@ -184,7 +177,6 @@ describe('File data change', () => {
test('Changing status', () => {
const file = new File({
source: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg',
encodedSource: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg',
mime: 'image/jpeg',
owner: 'emma',
root: '/files/emma',
Expand All @@ -200,7 +192,6 @@ describe('Altering attributes updates mtime', () => {
test('mtime is updated on existing attribute', () => {
const file = new File({
source: 'https://cloud.domain.com/remote.php/dav/files/emma',
encodedSource: 'https://cloud.domain.com/remote.php/dav/files/emma',
mime: 'image/jpeg',
owner: 'emma',
mtime: new Date(Date.UTC(1990, 0, 1, 0, 0, 0)),
Expand All @@ -219,7 +210,6 @@ describe('Altering attributes updates mtime', () => {
test('mtime is updated on new attribute', () => {
const file = new File({
source: 'https://cloud.domain.com/remote.php/dav/files/emma',
encodedSource: 'https://cloud.domain.com/remote.php/dav/files/emma',
mime: 'image/jpeg',
owner: 'emma',
mtime: new Date(Date.UTC(1990, 0, 1, 0, 0, 0)),
Expand All @@ -235,7 +225,6 @@ describe('Altering attributes updates mtime', () => {
test('mtime is updated on deleted attribute', () => {
const file = new File({
source: 'https://cloud.domain.com/remote.php/dav/files/emma',
encodedSource: 'https://cloud.domain.com/remote.php/dav/files/emma',
mime: 'image/jpeg',
owner: 'emma',
mtime: new Date(Date.UTC(1990, 0, 1, 0, 0, 0)),
Expand All @@ -254,7 +243,6 @@ describe('Altering attributes updates mtime', () => {
test('mtime is NOT updated if not initially defined', () => {
const file = new File({
source: 'https://cloud.domain.com/remote.php/dav/files/emma',
encodedSource: 'https://cloud.domain.com/remote.php/dav/files/emma',
mime: 'image/jpeg',
owner: 'emma',
attributes: {
Expand Down
6 changes: 0 additions & 6 deletions __tests__/files/folder.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ describe('Folder creation', () => {
test('Valid dav folder', () => {
const folder = new Folder({
source: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/',
encodedSource: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/',
owner: 'emma',
})

Expand All @@ -33,7 +32,6 @@ describe('Folder creation', () => {
test('Valid dav folder with root', () => {
const folder = new Folder({
source: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/Berlin',
encodedSource: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/Berlin',
owner: 'emma',
root: '/files/emma',
})
Expand All @@ -59,7 +57,6 @@ describe('Folder creation', () => {
test('Valid remote folder', () => {
const folder = new Folder({
source: 'https://domain.com/Photos/',
encodedSource: 'https://domain.com/Photos/',
owner: null,
})

Expand All @@ -86,7 +83,6 @@ describe('Folder data change', () => {
test('Rename a folder', () => {
const folder = new Folder({
source: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos',
encodedSource: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos',
owner: 'emma',
})

Expand All @@ -105,7 +101,6 @@ describe('Folder data change', () => {
test('Moving a folder', () => {
const folder = new Folder({
source: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/',
encodedSource: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/',
owner: 'emma',
})

Expand All @@ -124,7 +119,6 @@ describe('Folder data change', () => {
test('Moving a folder to a different location with root', () => {
const folder = new Folder({
source: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/',
encodedSource: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/',
owner: 'emma',
root: '/files/emma',
})
Expand Down
Loading

0 comments on commit f02fb42

Please sign in to comment.