1 import { removeLocalPath } from './routing';
3 describe('routing utils', () => {
4 test('removeLocalPath', () => {
5 expect(removeLocalPath('/u/123/path')).toBe('path');
6 expect(removeLocalPath('/u/123/path/sub-path/')).toBe('path/sub-path/');
7 expect(removeLocalPath('/u/123/')).toBe('');
8 expect(removeLocalPath('/u/123')).toBe('');
9 expect(removeLocalPath('/some/other/path')).toBe('/some/other/path');
10 expect(removeLocalPath('/some/other/path/')).toBe('/some/other/path/');
11 expect(removeLocalPath('/u/localID/')).toBe('/u/localID/');
12 expect(removeLocalPath('/u/')).toBe('/u/');