Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Constance <constancecchen@users.noreply.github.com>
  • Loading branch information
JasonStoltz and Constance committed Dec 3, 2020
1 parent 724bb27 commit 59f001d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import { setMockActions } from '../../../__mocks__/kea.mock';

import React from 'react';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

const mockAction = jest.fn();

let mockSubcription: (state: object) => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

.documentsSearchExperience__sidebar {
flex-grow: 1;
min-width: 300px;
min-width: $euiSize * 19;
}

.documentsSearchExperience__content {
Expand All @@ -17,5 +17,3 @@
flex-grow: 0;
}
}


Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('SearchExperienceContent', () => {

it('renders', () => {
const wrapper = shallow(<SearchExperienceContent />);
expect(wrapper.find(EuiFlexGroup).length).toBe(1);
expect(wrapper.isEmptyRender()).toBe(false);
});

it('passes engineName to the result view', () => {
Expand Down Expand Up @@ -69,7 +69,7 @@ describe('SearchExperienceContent', () => {
expect(wrapper.isEmptyRender()).toBe(true);
});

it('renders results if a search was performend and there are more than 0 totalResults', () => {
it('renders results if a search was performed and there are more than 0 totalResults', () => {
setMockSearchContextState({
...searchState,
wasSearched: true,
Expand Down Expand Up @@ -100,6 +100,7 @@ describe('SearchExperienceContent', () => {
totalResults: 0,
});
});

it('renders a no documents message', () => {
const wrapper = shallow(<SearchExperienceContent />);
expect(wrapper.find('[data-test-subj="documentsSearchResults"]').length).toBe(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const DocumentationLink: React.FC = () => (
href={`${DOCS_PREFIX}/indexing-documents-guide.html`}
>
{i18n.translate('xpack.enterpriseSearch.appSearch.documents.search.indexingGuide', {
defaultMessage: 'Read the Indexing Guide',
defaultMessage: 'Read the indexing guide',
})}
</EuiButton>
);
Expand All @@ -53,9 +53,7 @@ export const SearchExperienceContent: React.FC = () => {
const { myRole } = useValues(AppLogic);
const { engineName, isMetaEngine } = useValues(EngineLogic);

if (!wasSearched) {
return null;
}
if (!wasSearched) return null;

if (totalResults) {
return (
Expand Down

0 comments on commit 59f001d

Please sign in to comment.