grafana/public/app/core/specs/location_util.test.ts
Dominik Prokop dd37d003ef
Links: Assure base url when single stat, panel and data links are built (#21956)
* Assure base url when single stat, panel and data links are built

* Update public/app/features/dashboard/dashgrid/PanelHeader/PanelHeaderCorner.tsx

* Update public/app/features/panel/panellinks/link_srv.ts

* Update public/app/features/panel/panellinks/link_srv.ts

* Update public/app/features/panel/panellinks/link_srv.ts

* Update public/app/features/panel/panellinks/link_srv.ts

* Review updates

* Remove unnecessary code
2020-02-10 12:45:15 +01:00

17 lines
441 B
TypeScript

import locationUtil from 'app/core/utils/location_util';
jest.mock('app/core/config', () => {
return {
getConfig: () => ({ appSubUrl: '/subUrl' }),
};
});
describe('locationUtil', () => {
describe('With /subUrl as appSubUrl', () => {
it('/subUrl should be stripped', () => {
const urlWithoutMaster = locationUtil.stripBaseFromUrl('/subUrl/grafana/');
expect(urlWithoutMaster).toBe('/grafana/');
});
});
});