forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor out components shared with Workplace Search (#18)
* Move getUserName helper to shared - in preparation for Workplace Search plugin also using this helper * Move Setup Guide layout to a shared component * Setup Guide: add extra props for standard/native auth links Note: It's possible this commit may be unnecessary if we can publish shared Enterprise Search security mode docs
- Loading branch information
Showing
11 changed files
with
339 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions
7
x-pack/plugins/enterprise_search/public/applications/shared/get_username/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export { getUserName } from './get_username'; |
7 changes: 7 additions & 0 deletions
7
x-pack/plugins/enterprise_search/public/applications/shared/setup_guide/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export { SetupGuide } from './setup_guide'; |
File renamed without changes.
44 changes: 44 additions & 0 deletions
44
x-pack/plugins/enterprise_search/public/applications/shared/setup_guide/setup_guide.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
import { EuiSteps, EuiIcon, EuiLink } from '@elastic/eui'; | ||
|
||
import { mountWithContext } from '../../__mocks__'; | ||
|
||
import { SetupGuide } from './'; | ||
|
||
describe('SetupGuide', () => { | ||
it('renders', () => { | ||
const wrapper = shallow( | ||
<SetupGuide productName="Enterprise Search" productEuiIcon="logoEnterpriseSearch"> | ||
<p data-test-subj="test">Wow!</p> | ||
</SetupGuide> | ||
); | ||
|
||
expect(wrapper.find('h1').text()).toEqual('Enterprise Search'); | ||
expect(wrapper.find(EuiIcon).prop('type')).toEqual('logoEnterpriseSearch'); | ||
expect(wrapper.find('[data-test-subj="test"]').text()).toEqual('Wow!'); | ||
expect(wrapper.find(EuiSteps)).toHaveLength(1); | ||
}); | ||
|
||
it('renders with optional auth links', () => { | ||
const wrapper = mountWithContext( | ||
<SetupGuide | ||
productName="Foo" | ||
productEuiIcon="logoAppSearch" | ||
standardAuthLink="http://foo.com" | ||
elasticsearchNativeAuthLink="http://bar.com" | ||
> | ||
Baz | ||
</SetupGuide> | ||
); | ||
|
||
expect(wrapper.find(EuiLink).first().prop('href')).toEqual('http://bar.com'); | ||
expect(wrapper.find(EuiLink).last().prop('href')).toEqual('http://foo.com'); | ||
}); | ||
}); |
Oops, something went wrong.