forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ML] Single Metric Viewer: Fix time bounds with custom strings. (elas…
…tic#55045) Makes sure to set bounds via timefilter.getBounds() again and not infer directly from globalState to correctly consider custom strings like now-15m.
- Loading branch information
Showing
6 changed files
with
85 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
x-pack/legacy/plugins/ml/public/application/routing/routes/timeseriesexplorer.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { MemoryRouter } from 'react-router-dom'; | ||
import { render } from '@testing-library/react'; | ||
|
||
import { I18nProvider } from '@kbn/i18n/react'; | ||
|
||
import { TimeSeriesExplorerUrlStateManager } from './timeseriesexplorer'; | ||
|
||
jest.mock('ui/new_platform'); | ||
|
||
describe('TimeSeriesExplorerUrlStateManager', () => { | ||
test('Initial render shows "No single metric jobs found"', () => { | ||
const props = { | ||
config: { get: () => 'Browser' }, | ||
jobsWithTimeRange: [], | ||
}; | ||
|
||
const { container } = render( | ||
<I18nProvider> | ||
<MemoryRouter> | ||
<TimeSeriesExplorerUrlStateManager {...props} /> | ||
</MemoryRouter> | ||
</I18nProvider> | ||
); | ||
|
||
expect(container.textContent).toContain('No single metric jobs found'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters