bridge_srv.jest.ts 514 B

12345678910111213141516171819202122
  1. import { BridgeSrv } from 'app/core/services/bridge_srv';
  2. jest.mock('app/core/config', () => {
  3. return {
  4. appSubUrl: '/subUrl',
  5. };
  6. });
  7. describe('BridgeSrv', () => {
  8. let searchSrv;
  9. beforeEach(() => {
  10. searchSrv = new BridgeSrv(null, null, null, null);
  11. });
  12. describe('With /subUrl as appSubUrl', () => {
  13. it('/subUrl should be stripped', () => {
  14. const urlWithoutMaster = searchSrv.stripBaseFromUrl('/subUrl/grafana/');
  15. expect(urlWithoutMaster).toBe('/grafana/');
  16. });
  17. });
  18. });