Skip to content

Commit 4ca1301

Browse files
committed
Revert "feat!: add NodeData.encodedSource "
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
1 parent d3ae6ca commit 4ca1301

File tree

8 files changed

+0
-125
lines changed

8 files changed

+0
-125
lines changed

__tests__/dav/dav.spec.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ describe('davResultToNode', () => {
5050
expect(node.basename).toBe(result.basename)
5151
expect(node.extension).toBe('.md')
5252
expect(node.source).toBe('https://localhost/dav/files/test/New folder/Neue Textdatei.md')
53-
expect(node.encodedSource).toBe('https://localhost/dav/files/test/New%20folder/Neue%20Textdatei.md')
5453
expect(node.root).toBe(davRootPath)
5554
expect(node.path).toBe('/New folder/Neue Textdatei.md')
5655
expect(node.dirname).toBe('/New folder')
@@ -66,7 +65,6 @@ describe('davResultToNode', () => {
6665
expect(node.extension).toBe('.md')
6766
expect(node.root).toBe('/root')
6867
expect(node.source).toBe('https://localhost/dav/root/New folder/Neue Textdatei.md')
69-
expect(node.encodedSource).toBe('https://localhost/dav/root/New%20folder/Neue%20Textdatei.md')
7068
expect(node.path).toBe('/New folder/Neue Textdatei.md')
7169
expect(node.dirname).toBe('/New folder')
7270
})
@@ -77,21 +75,9 @@ describe('davResultToNode', () => {
7775
expect(node.basename).toBe(remoteResult.basename)
7876
expect(node.extension).toBe('.md')
7977
expect(node.source).toBe('http://example.com/dav/root/New folder/Neue Textdatei.md')
80-
expect(node.encodedSource).toBe('http://example.com/dav/root/New%20folder/Neue%20Textdatei.md')
8178
expect(node.path).toBe('/New folder/Neue Textdatei.md')
8279
expect(node.dirname).toBe('/New folder')
8380
})
84-
85-
test('encode special characters', () => {
86-
const remoteResult = { ...result, basename: 'realy #1\'s.md', filename: '/root/~⛰️ shot of a $[big} mountain/realy #1\'s.md' }
87-
const node = davResultToNode(remoteResult, '/root', 'http://example.com/dav')
88-
expect(node.basename).toBe(remoteResult.basename)
89-
expect(node.extension).toBe('.md')
90-
expect(node.source).toBe('http://example.com/dav/root/~⛰️ shot of a $[big} mountain/realy #1\'s.md')
91-
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')
92-
expect(node.path).toBe('/~⛰️ shot of a $[big} mountain/realy #1\'s.md')
93-
expect(node.dirname).toBe('/~⛰️ shot of a $[big} mountain')
94-
})
9581
})
9682

9783
describe('DAV requests', () => {

__tests__/files/file.spec.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ describe('File creation', () => {
99
test('Valid dav file', () => {
1010
const file = new File({
1111
source: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg',
12-
encodedSource: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg',
1312
mime: 'image/jpeg',
1413
owner: 'emma',
1514
mtime: new Date(Date.UTC(2023, 0, 1, 0, 0, 0)),
@@ -44,7 +43,6 @@ describe('File creation', () => {
4443
test('Valid dav file with root', () => {
4544
const file = new File({
4645
source: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg',
47-
encodedSource: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg',
4846
mime: 'image/jpeg',
4947
owner: 'emma',
5048
root: '/files/emma',
@@ -72,7 +70,6 @@ describe('File creation', () => {
7270
test('Valid remote file', () => {
7371
const file = new File({
7472
source: 'https://domain.com/Photos/picture.jpg',
75-
encodedSource: 'https://domain.com/Photos/picture.jpg',
7673
mime: 'image/jpeg',
7774
owner: null,
7875
})
@@ -100,7 +97,6 @@ describe('File data change', () => {
10097
test('Rename a file', () => {
10198
const file = new File({
10299
source: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg',
103-
encodedSource: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg',
104100
mime: 'image/jpeg',
105101
owner: 'emma',
106102
mtime: new Date(Date.UTC(2023, 0, 1, 0, 0, 0)),
@@ -125,7 +121,6 @@ describe('File data change', () => {
125121
test('Moving a file', () => {
126122
const file = new File({
127123
source: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg',
128-
encodedSource: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg',
129124
mime: 'image/jpeg',
130125
owner: 'emma',
131126
mtime: new Date(Date.UTC(2023, 0, 1, 0, 0, 0)),
@@ -150,7 +145,6 @@ describe('File data change', () => {
150145
test('Moving a file to an invalid destination throws', () => {
151146
const file = new File({
152147
source: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg',
153-
encodedSource: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg',
154148
mime: 'image/jpeg',
155149
owner: 'emma',
156150
mtime: new Date(Date.UTC(2023, 0, 1, 0, 0, 0)),
@@ -163,7 +157,6 @@ describe('File data change', () => {
163157
test('Moving a file to a different folder with root', () => {
164158
const file = new File({
165159
source: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg',
166-
encodedSource: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg',
167160
mime: 'image/jpeg',
168161
owner: 'emma',
169162
root: '/files/emma',
@@ -184,7 +177,6 @@ describe('File data change', () => {
184177
test('Changing status', () => {
185178
const file = new File({
186179
source: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg',
187-
encodedSource: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg',
188180
mime: 'image/jpeg',
189181
owner: 'emma',
190182
root: '/files/emma',
@@ -200,7 +192,6 @@ describe('Altering attributes updates mtime', () => {
200192
test('mtime is updated on existing attribute', () => {
201193
const file = new File({
202194
source: 'https://cloud.domain.com/remote.php/dav/files/emma',
203-
encodedSource: 'https://cloud.domain.com/remote.php/dav/files/emma',
204195
mime: 'image/jpeg',
205196
owner: 'emma',
206197
mtime: new Date(Date.UTC(1990, 0, 1, 0, 0, 0)),
@@ -219,7 +210,6 @@ describe('Altering attributes updates mtime', () => {
219210
test('mtime is updated on new attribute', () => {
220211
const file = new File({
221212
source: 'https://cloud.domain.com/remote.php/dav/files/emma',
222-
encodedSource: 'https://cloud.domain.com/remote.php/dav/files/emma',
223213
mime: 'image/jpeg',
224214
owner: 'emma',
225215
mtime: new Date(Date.UTC(1990, 0, 1, 0, 0, 0)),
@@ -235,7 +225,6 @@ describe('Altering attributes updates mtime', () => {
235225
test('mtime is updated on deleted attribute', () => {
236226
const file = new File({
237227
source: 'https://cloud.domain.com/remote.php/dav/files/emma',
238-
encodedSource: 'https://cloud.domain.com/remote.php/dav/files/emma',
239228
mime: 'image/jpeg',
240229
owner: 'emma',
241230
mtime: new Date(Date.UTC(1990, 0, 1, 0, 0, 0)),
@@ -254,7 +243,6 @@ describe('Altering attributes updates mtime', () => {
254243
test('mtime is NOT updated if not initially defined', () => {
255244
const file = new File({
256245
source: 'https://cloud.domain.com/remote.php/dav/files/emma',
257-
encodedSource: 'https://cloud.domain.com/remote.php/dav/files/emma',
258246
mime: 'image/jpeg',
259247
owner: 'emma',
260248
attributes: {

__tests__/files/folder.spec.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ describe('Folder creation', () => {
88
test('Valid dav folder', () => {
99
const folder = new Folder({
1010
source: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/',
11-
encodedSource: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/',
1211
owner: 'emma',
1312
})
1413

@@ -33,7 +32,6 @@ describe('Folder creation', () => {
3332
test('Valid dav folder with root', () => {
3433
const folder = new Folder({
3534
source: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/Berlin',
36-
encodedSource: 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/Berlin',
3735
owner: 'emma',
3836
root: '/files/emma',
3937
})
@@ -59,7 +57,6 @@ describe('Folder creation', () => {
5957
test('Valid remote folder', () => {
6058
const folder = new Folder({
6159
source: 'https://domain.com/Photos/',
62-
encodedSource: 'https://domain.com/Photos/',
6360
owner: null,
6461
})
6562

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

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

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

0 commit comments

Comments
 (0)