|
3 | 3 | * or more contributor license agreements. Licensed under the Elastic License; |
4 | 4 | * you may not use this file except in compliance with the Elastic License. |
5 | 5 | */ |
6 | | -import React from 'react'; |
7 | 6 | import { render } from '@testing-library/react'; |
8 | 7 | import { shallow } from 'enzyme'; |
9 | | -import * as urlParamsHooks from '../../../../hooks/useUrlParams'; |
10 | | -import * as hooks from '../../../../hooks/useFetcher'; |
| 8 | +import React from 'react'; |
11 | 9 | import { TraceLink } from '../'; |
| 10 | +import * as hooks from '../../../../hooks/useFetcher'; |
| 11 | +import * as urlParamsHooks from '../../../../hooks/useUrlParams'; |
12 | 12 | import { MockApmPluginContextWrapper } from '../../../../utils/testHelpers'; |
13 | | -import * as routeConfig from '../../Main/route_config'; |
14 | | -import { BreadcrumbRoute } from '../../Main/ProvideBreadcrumbs'; |
15 | 13 |
|
16 | 14 | const renderOptions = { wrapper: MockApmPluginContextWrapper }; |
17 | 15 |
|
18 | | -jest.spyOn(routeConfig, 'getRoutes').mockReturnValue([ |
19 | | - { |
20 | | - path: '/services/:serviceName/transactions/view', |
21 | | - name: 'transaction_name' |
22 | | - }, |
23 | | - { |
24 | | - path: '/traces', |
25 | | - name: 'traces' |
26 | | - } |
27 | | -] as BreadcrumbRoute[]); |
| 16 | +jest.mock('../../Main/route_config', () => ({ |
| 17 | + routes: [ |
| 18 | + { |
| 19 | + path: '/services/:serviceName/transactions/view', |
| 20 | + name: 'transaction_name' |
| 21 | + }, |
| 22 | + { |
| 23 | + path: '/traces', |
| 24 | + name: 'traces' |
| 25 | + } |
| 26 | + ] |
| 27 | +})); |
28 | 28 |
|
29 | 29 | describe('TraceLink', () => { |
30 | 30 | afterAll(() => { |
|
0 commit comments