mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[ML] Transform: Fix <DefinePivotSummary /> jest test. (#195998)
## Summary Fixes #195992 (failing test). Updates the mock for the preview endpoint to make the test pass again. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)
This commit is contained in:
parent
5262902a86
commit
c4d64039b3
2 changed files with 9 additions and 4 deletions
|
@ -67,7 +67,14 @@ dataStart.search.search = jest.fn(({ params }: IKibanaSearchRequest) => {
|
|||
}) as ISearchGeneric;
|
||||
|
||||
// Replace mock to support tests for `use_index_data`.
|
||||
coreSetup.http.post = jest.fn().mockResolvedValue([]);
|
||||
coreSetup.http.post = jest.fn().mockImplementation((endpoint) => {
|
||||
if (endpoint === '/internal/transform/transforms/_preview') {
|
||||
return Promise.resolve({
|
||||
generated_dest_index: { mappings: { properties: {} } },
|
||||
preview: [],
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
const appDependencies: AppDependencies = {
|
||||
analytics: coreStart.analytics,
|
||||
|
|
|
@ -20,9 +20,7 @@ import { StepDefineSummary } from './step_define_summary';
|
|||
|
||||
jest.mock('../../../../app_dependencies');
|
||||
|
||||
// Failing: https://github.com/elastic/kibana/issues/195992
|
||||
describe.skip('Transform: <DefinePivotSummary />', () => {
|
||||
// Using the async/await wait()/done() pattern to avoid act() errors.
|
||||
describe('Transform: <DefinePivotSummary />', () => {
|
||||
test('Minimal initialization', async () => {
|
||||
// Arrange
|
||||
const queryClient = new QueryClient();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue