kibana/packages/kbn-search-index-documents/components/documents_overview.test.tsx
Saarika Bhasi 7ecd525a02
[Search] Move enterprise_search index documents to common package (#172211)
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>
2023-12-05 10:33:15 -05:00

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();
});
});