Skip to content

Commit

Permalink
Add link to top bar
Browse files Browse the repository at this point in the history
The external href to sources will be changed once that component is built
  • Loading branch information
scottybollinger committed Jan 4, 2021
1 parent b3b0aad commit 25c6c5c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,23 @@ describe('WorkplaceSearchHeaderActions', () => {
expect(wrapper.isEmptyRender()).toBe(true);
});

it('renders a link to the personal dashboard', () => {
externalUrl.enterpriseSearchUrl = 'http://localhost:3002';

const wrapper = shallow(<WorkplaceSearchHeaderActions />);

expect(wrapper.find(EuiButtonEmpty).first().prop('href')).toEqual(
'http://localhost:3002/ws/sources'
);
});

it('renders a link to the search application', () => {
externalUrl.enterpriseSearchUrl = 'http://localhost:3002';

const wrapper = shallow(<WorkplaceSearchHeaderActions />);

expect(wrapper.find(EuiButtonEmpty).prop('href')).toEqual('http://localhost:3002/ws/search');
expect(wrapper.find(EuiButtonEmpty).last().prop('href')).toEqual(
'http://localhost:3002/ws/search'
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,23 @@ export const WorkplaceSearchHeaderActions: React.FC = () => {
if (!externalUrl.enterpriseSearchUrl) return null;

return (
<EuiButtonEmpty
href={getWorkplaceSearchUrl('/search')}
target="_blank"
iconType="search"
style={{ marginRight: 5 }}
>
<>
<EuiButtonEmpty
href={getWorkplaceSearchUrl('/sources')}
target="_blank"
iconType="user"
style={{ marginRight: 5 }}
>
<EuiText size="s">{NAV.PERSONAL_DASHBOARD}</EuiText>
</EuiButtonEmpty>
<EuiButtonEmpty
href={getWorkplaceSearchUrl('/search')}
target="_blank"
iconType="search"
style={{ marginRight: 5 }}
>
<EuiText size="s">{NAV.SEARCH}</EuiText>
</EuiButtonEmpty>
</EuiButtonEmpty>
</>
);
};

0 comments on commit 25c6c5c

Please sign in to comment.