location_util.test.ts 418 B

12345678910111213141516
  1. import locationUtil from 'app/core/utils/location_util';
  2. jest.mock('app/core/config', () => {
  3. return {
  4. appSubUrl: '/subUrl',
  5. };
  6. });
  7. describe('locationUtil', () => {
  8. describe('With /subUrl as appSubUrl', () => {
  9. it('/subUrl should be stripped', () => {
  10. const urlWithoutMaster = locationUtil.stripBaseFromUrl('/subUrl/grafana/');
  11. expect(urlWithoutMaster).toBe('/grafana/');
  12. });
  13. });
  14. });