diff --git a/public/components/common/__test__/__snapshots__/flyout.test.tsx.snap b/public/components/common/__test__/__snapshots__/flyout.test.tsx.snap index d2ffd1d..eb98701 100644 --- a/public/components/common/__test__/__snapshots__/flyout.test.tsx.snap +++ b/public/components/common/__test__/__snapshots__/flyout.test.tsx.snap @@ -2,5215 +2,93 @@ exports[`Flyout component Renders flyout component 1`] = ` - - - - - - - - } - onActivation={[Function]} - onDeactivation={[Function]} - persistentFocus={false} - returnFocus={[Function]} - shards={Array []} - sideCar={ - Object { - "assignMedium": [Function], - "assignSyncMedium": [Function], - "options": Object { - "async": true, - "ssr": false, - }, - "read": [Function], - "useMedium": [Function], - } - } - > - - - - } - onActivation={[Function]} - onDeactivation={[Function]} - persistentFocus={false} - returnFocus={[Function]} - shards={Array []} - > - - - - } - onActivation={[Function]} - onDeactivation={[Function]} - persistentFocus={false} - returnFocus={[Function]} - shards={Array []} - /> - - - - -
- -
- - - - - - -
- -

- - - Help - - -

-
-
-
- -
-
-
- -
-

- - - Query format - - -

-

- - - , - "methodName": - - , - "queryDslLink": - - , - "search": - - , - "variableName": - - , - } - } - > - - Enter a query in - - - - - OpenSearch Query DSL - - - - - - - - - - - (opens in a new tab or window) - - - - - - . Use the - - - - - - - %SearchText% - - - - - - - variable to refer - to the text in the search bar. When you enter - - - - Search - - - - , the queries are sent to the search - engine using the - - - - - - - GET - - - - - - - HTTP method and the - - - - - - - _search - - - - - - - endpoint. - - -

-

- - - Example - - -

-
-

- - - 1. Enter the search text in the search bar. - - -

-

- - - , - } - } - > - - 2. Select an index for - - - - Query 1 - - - - and enter a query. - - -

-

- - - , - "speaker": - - , - "textEntry": - - , - } - } - > - - The following example searches the - - - - - - - speaker - - - - - - - and - - - - - - - text_entry - - - - - - - fields of the - - - - - - - - shakespeare - - - - - - - index for the search text: - - -

- - -
-
-                                                
-                                                  
-                                                    
-
-                                                  
-                                                  
-                                                    
-                                                      {
-                                                    
-                                                    
-
-                                                  
-                                                  
-                                                      
-                                                    
-                                                      "query"
-                                                    
-                                                    
-                                                      :
-                                                    
-                                                     
-                                                    
-                                                      {
-                                                    
-                                                    
-
-                                                  
-                                                  
-                                                        
-                                                    
-                                                      "multi_match"
-                                                    
-                                                    
-                                                      :
-                                                    
-                                                     
-                                                    
-                                                      {
-                                                    
-                                                    
-
-                                                  
-                                                  
-                                                          
-                                                    
-                                                      "query"
-                                                    
-                                                    
-                                                      :
-                                                    
-                                                     
-                                                    
-                                                      "%SearchText%"
-                                                    
-                                                    
-                                                      ,
-                                                    
-                                                    
-
-                                                  
-                                                  
-                                                          
-                                                    
-                                                      "fields"
-                                                    
-                                                    
-                                                      :
-                                                    
-                                                     
-                                                    
-                                                      [
-                                                    
-                                                    
-                                                      "speaker"
-                                                    
-                                                    
-                                                      ,
-                                                    
-                                                     
-                                                    
-                                                      "text_entry"
-                                                    
-                                                    
-                                                      ]
-                                                    
-                                                    
-
-                                                  
-                                                  
-                                                        
-                                                    
-                                                      }
-                                                    
-                                                    
-
-                                                  
-                                                  
-                                                      
-                                                    
-                                                      }
-                                                    
-                                                    
-
-                                                  
-                                                  
-                                                    
-                                                      }
-                                                    
-                                                    
-
-                                                  
-                                                  
-                                                
-                                              
-
-
- - - - - - - - - - - -
-
-
-
-
-

- - - , - } - } - > - - 3. Select an index for - - - - Query 2 - - - - and enter a query. - - -

-

- - - , - } - } - > - - You can see how boosting a field affects the results. The following - query boosts the - - - - - - - speaker - - - - - - - field: - - -

- - -
-
-                                                
-                                                  
-                                                    
-
-                                                  
-                                                  
-                                                    
-                                                      {
-                                                    
-                                                    
-
-                                                  
-                                                  
-                                                      
-                                                    
-                                                      "query"
-                                                    
-                                                    
-                                                      :
-                                                    
-                                                     
-                                                    
-                                                      {
-                                                    
-                                                    
-
-                                                  
-                                                  
-                                                        
-                                                    
-                                                      "multi_match"
-                                                    
-                                                    
-                                                      :
-                                                    
-                                                     
-                                                    
-                                                      {
-                                                    
-                                                    
-
-                                                  
-                                                  
-                                                          
-                                                    
-                                                      "query"
-                                                    
-                                                    
-                                                      :
-                                                    
-                                                     
-                                                    
-                                                      "%SearchText%"
-                                                    
-                                                    
-                                                      ,
-                                                    
-                                                    
-
-                                                  
-                                                  
-                                                          
-                                                    
-                                                      "fields"
-                                                    
-                                                    
-                                                      :
-                                                    
-                                                     
-                                                    
-                                                      [
-                                                    
-                                                    
-                                                      "speaker^3"
-                                                    
-                                                    
-                                                      ,
-                                                    
-                                                     
-                                                    
-                                                      "text_entry"
-                                                    
-                                                    
-                                                      ]
-                                                    
-                                                    
-
-                                                  
-                                                  
-                                                        
-                                                    
-                                                      }
-                                                    
-                                                    
-
-                                                  
-                                                  
-                                                      
-                                                    
-                                                      }
-                                                    
-                                                    
-
-                                                  
-                                                  
-                                                    
-                                                      }
-                                                    
-                                                    
-
-                                                  
-                                                  
-                                                
-                                              
-
-
- - - - - - - - - - - -
-
-
-
-
-

- - - , - } - } - > - - To learn more about boosts, see the - - - - - Multi-match Query Documentation - - - - - - - - - - - (opens in a new tab or window) - - - - - - . - - -

-

- - - 4. Compare results - - -

-

- - - , - } - } - > - - Select - - - - Search - - - - and compare the results in Results 1 and Results 2. - - -

-
-
-
-
-
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - + locale="en" + messages={Object {}} + textComponent={Symbol(react.fragment)} +> + + + + + `; diff --git a/public/components/common/__test__/flyout.test.tsx b/public/components/common/__test__/flyout.test.tsx index bd7cfaf..9598754 100644 --- a/public/components/common/__test__/flyout.test.tsx +++ b/public/components/common/__test__/flyout.test.tsx @@ -3,24 +3,24 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { configure, mount } from 'enzyme'; +import { configure, shallow } from 'enzyme'; import Adapter from 'enzyme-adapter-react-16'; import React from 'react'; import { waitFor } from '@testing-library/react'; import { Flyout } from '../flyout'; import { SearchRelevanceContextProvider } from '../../../contexts'; -import { IntlProvider } from 'react-intl'; +import { I18nProvider } from '@osd/i18n/react'; describe('Flyout component', () => { configure({ adapter: new Adapter() }); it('Renders flyout component', async () => { - const wrapper = mount( - + const wrapper = shallow( + - + ); wrapper.update();