global_event_srv.jest.ts 575 B

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