diff options
Diffstat (limited to 'web_src/js/utils.test.js')
-rw-r--r-- | web_src/js/utils.test.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/web_src/js/utils.test.js b/web_src/js/utils.test.js index 4efe916231..306acd34af 100644 --- a/web_src/js/utils.test.js +++ b/web_src/js/utils.test.js @@ -139,6 +139,11 @@ test('blobToDataURI', async () => { }); test('toAbsoluteUrl', () => { + expect(toAbsoluteUrl('//host/dir')).toEqual('http://host/dir'); + expect(toAbsoluteUrl('https://host/dir')).toEqual('https://host/dir'); + expect(toAbsoluteUrl('')).toEqual('http://localhost:3000'); expect(toAbsoluteUrl('/user/repo')).toEqual('http://localhost:3000/user/repo'); + + expect(() => toAbsoluteUrl('path')).toThrowError('unsupported'); }); |