mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-24 18:08:19 +03:00
14 lines
624 B
TypeScript
14 lines
624 B
TypeScript
|
import { replaceAuthorityFromUri } from '../../../src/utils/helpers/uri';
|
||
|
|
||
|
describe('uri-helper', () => {
|
||
|
describe('replaceAuthorityFromUri', () => {
|
||
|
it.each([
|
||
|
[ 'http://something.com/foo/bar', 'www.new.to', 'http://www.new.to/foo/bar' ],
|
||
|
[ 'https://www.authori.ty:8000/', 'doma.in', 'https://doma.in/' ],
|
||
|
[ 'http://localhost:8080/this/is-a-long/path', 'somewhere:8888', 'http://somewhere:8888/this/is-a-long/path' ],
|
||
|
])('replaces authority as expected', (uri, newAuthority, expectedResult) => {
|
||
|
expect(replaceAuthorityFromUri(uri, newAuthority)).toEqual(expectedResult);
|
||
|
});
|
||
|
});
|
||
|
});
|