pathTools.test.js 457 Bytes
Newer Older
1 2 3 4 5 6 7
import { urlToList } from './pathTools';

describe('test urlToList', () => {
  it('A path', () => {
    expect(urlToList('/userinfo')).toEqual(['/userinfo']);
  });
  it('Secondary path', () => {
jim's avatar
jim committed
8
    expect(urlToList('/userinfo/2144')).toEqual(['/userinfo', '/userinfo/2144']);
9 10 11 12 13 14 15 16 17
  });
  it('Three paths', () => {
    expect(urlToList('/userinfo/2144/addr')).toEqual([
      '/userinfo',
      '/userinfo/2144',
      '/userinfo/2144/addr',
    ]);
  });
});