Skip to content

Commit

Permalink
feat: add encodedSource tests
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv committed Oct 3, 2023
1 parent a8a2910 commit dd135af
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions __tests__/files/node.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,3 +387,17 @@ describe('Undefined properties are allowed', () => {
})).not.toThrow()
})
})

describe('Encoded source is handled properly', () => {
test('File', () => {
const file = new File({
source: 'https://cloud.domain.com/remote.php/dav/files/em ma!/Photos~⛰️ shot of a $[big} mountain/realy #1\'s.md',
owner: 'em ma!',
id: 123456,
mime: 'image/jpeg',
root: '/files/em ma!',
})

expect(file.encodedSource).toBe('https://cloud.domain.com/remote.php/dav/files/em%20ma!/Photos~%E2%9B%B0%EF%B8%8F%20shot%20of%20a%20%24%5Bbig%7D%20mountain/realy%20%231\'s.md')
})
})

0 comments on commit dd135af

Please sign in to comment.