mirror of
https://github.com/elastic/kibana.git
synced 2025-06-28 11:05:39 -04:00
This PR:
* extracts `enterprise_search` index documents component to common
package.
* Uses EUI pagination, converting Elasticsearch`from` & `size` to EUI
pagination standard for documents list
### Screen Recording
f585d9cc
-f92c-44f4-aead-23c75c107a0f
### Checklist
Delete any items that are not applicable to this PR.
- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [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
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
30 lines
1.1 KiB
TypeScript
30 lines
1.1 KiB
TypeScript
/*
|
|
* 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 and the Server Side Public License, v 1; you may not use this file except
|
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
* Side Public License, v 1.
|
|
*/
|
|
import { I18nProvider } from '@kbn/i18n-react';
|
|
import { render, screen } from '@testing-library/react';
|
|
import React from 'react';
|
|
import '@testing-library/jest-dom';
|
|
import { DEFAULT_VALUES } from './documents_list.test';
|
|
import { DocumentList } from './document_list';
|
|
import { DocumentsOverview } from './documents_overview';
|
|
|
|
describe('DocumentList', () => {
|
|
test('render empty', async () => {
|
|
render(
|
|
<I18nProvider>
|
|
<DocumentsOverview
|
|
dataTelemetryIdPrefix="entSearch-telemetry"
|
|
searchQueryCallback={() => {}}
|
|
documentComponent={<DocumentList {...DEFAULT_VALUES} />}
|
|
/>
|
|
</I18nProvider>
|
|
);
|
|
|
|
expect(screen.getByText('Browse documents')).toBeInTheDocument();
|
|
});
|
|
});
|