-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Enterprise Search] Engine list page - fetch engines list with Backen…
…d API call (#148495) ## Summary ### Engine list UI page 1. Replaced mocked values with Kibana API call in Fetch engines and added test cases 2. Replaced with the types from the `common ` directory suggestion based on [PR comment](#147399 (comment)) 3. Removed documents column from UI <img width="1675" alt="Screen Shot 2023-01-05 at 8 07 15 PM" src="https://user-images.githubusercontent.com/55930906/210909095-3697fb62-758d-4dd1-89c1-2487f3b08db1.png"> ### Checklist Delete any items that are not applicable to this PR. - [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 ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information
1 parent
f6adf64
commit 0da7113
Showing
8 changed files
with
99 additions
and
87 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
...public/applications/enterprise_search_content/api/engines/fetch_engines_api_logic.test.ts
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,36 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { mockHttpValues } from '../../../__mocks__/kea_logic'; | ||
|
||
import { nextTick } from '@kbn/test-jest-helpers'; | ||
|
||
import { fetchEngines } from './fetch_engines_api_logic'; | ||
|
||
describe('FetchEnginesAPILogic', () => { | ||
const { http } = mockHttpValues; | ||
beforeEach(() => { | ||
jest.clearAllMocks(); | ||
}); | ||
describe('fetchEnginesAPILogic', () => { | ||
it('request list engines api', async () => { | ||
const promise = Promise.resolve({ result: 'result' }); | ||
http.get.mockReturnValue(promise); | ||
const result = fetchEngines({ | ||
meta: { from: 0, size: 10, total: 0 }, | ||
}); | ||
await nextTick(); | ||
expect(http.get).toHaveBeenCalledWith('/internal/enterprise_search/engines', { | ||
query: { from: 0, size: 10 }, | ||
}); | ||
|
||
await expect(result).resolves.toEqual({ | ||
result: 'result', | ||
}); | ||
}); | ||
}); | ||
}); |
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
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
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