Skip to content

Commit

Permalink
[Enterprise Search] Fix schema errors button (#84842) (#84856)
Browse files Browse the repository at this point in the history
* Fix schema errors button

When migrated, the button was wrapping the link and it should be the other way around. This caused a blue link color.

* Remove redundant true value

* TIL EuiButtonTo
  • Loading branch information
scottybollinger committed Dec 3, 2020
1 parent 874df03 commit 8096c61
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,18 @@
import React from 'react';
import { shallow } from 'enzyme';

import { EuiCallOut, EuiButton } from '@elastic/eui';
import { EuiCallOut } from '@elastic/eui';

import { EuiLinkTo } from '../react_router_helpers';
import { EuiButtonTo } from '../react_router_helpers';

import { IndexingStatusErrors } from './indexing_status_errors';

describe('IndexingStatusErrors', () => {
it('renders', () => {
const wrapper = shallow(<IndexingStatusErrors viewLinkPath="/path" />);

expect(wrapper.find(EuiButton)).toHaveLength(1);
expect(wrapper.find(EuiCallOut)).toHaveLength(1);
expect(wrapper.find(EuiLinkTo)).toHaveLength(1);
expect(wrapper.find(EuiLinkTo).prop('to')).toEqual('/path');
expect(wrapper.find(EuiButtonTo)).toHaveLength(1);
expect(wrapper.find(EuiButtonTo).prop('to')).toEqual('/path');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

import React from 'react';

import { EuiButton, EuiCallOut } from '@elastic/eui';
import { EuiCallOut } from '@elastic/eui';

import { EuiLinkTo } from '../react_router_helpers';
import { EuiButtonTo } from '../react_router_helpers';

import { INDEXING_STATUS_HAS_ERRORS_TITLE, INDEXING_STATUS_HAS_ERRORS_BUTTON } from './constants';

Expand All @@ -24,8 +24,9 @@ export const IndexingStatusErrors: React.FC<IIndexingStatusErrorsProps> = ({ vie
data-test-subj="IndexingStatusErrors"
>
<p>{INDEXING_STATUS_HAS_ERRORS_TITLE}</p>
<EuiButton color="danger" fill={true} size="s" data-test-subj="ViewErrorsButton">
<EuiLinkTo to={viewLinkPath}>{INDEXING_STATUS_HAS_ERRORS_BUTTON}</EuiLinkTo>
</EuiButton>

<EuiButtonTo to={viewLinkPath} color="danger" fill size="s" data-test-subj="ViewErrorsButton">
{INDEXING_STATUS_HAS_ERRORS_BUTTON}
</EuiButtonTo>
</EuiCallOut>
);

0 comments on commit 8096c61

Please sign in to comment.