-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add icons to Add Data list and tutorial view (#16592)
* add icons for home tutorials * add test for Synopsis component
- Loading branch information
Showing
25 changed files
with
452 additions
and
25 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
149 changes: 149 additions & 0 deletions
149
src/core_plugins/kibana/public/home/components/__snapshots__/synopsis.test.js.snap
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,149 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`props iconType 1`] = ` | ||
<a | ||
className="euiLink synopsis" | ||
data-test-subj="homeSynopsisLinkgreat tutorial" | ||
href="link_to_item" | ||
> | ||
<EuiFlexGroup | ||
alignItems="stretch" | ||
component="div" | ||
gutterSize="l" | ||
justifyContent="flexStart" | ||
responsive={true} | ||
wrap={false} | ||
> | ||
<EuiFlexItem | ||
component="div" | ||
grow={false} | ||
> | ||
<EuiIcon | ||
size="xl" | ||
type="logoApache" | ||
/> | ||
</EuiFlexItem> | ||
<EuiFlexItem | ||
className="synopsisContent" | ||
component="div" | ||
grow={true} | ||
> | ||
<EuiTitle | ||
className="synopsisTitle" | ||
size="s" | ||
> | ||
<h4> | ||
Great tutorial | ||
</h4> | ||
</EuiTitle> | ||
<EuiText | ||
className="synopsisBody" | ||
> | ||
<p> | ||
<EuiTextColor | ||
color="subdued" | ||
> | ||
this is a great tutorial about... | ||
</EuiTextColor> | ||
</p> | ||
</EuiText> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
</a> | ||
`; | ||
|
||
exports[`props iconUrl 1`] = ` | ||
<a | ||
className="euiLink synopsis" | ||
data-test-subj="homeSynopsisLinkgreat tutorial" | ||
href="link_to_item" | ||
> | ||
<EuiFlexGroup | ||
alignItems="stretch" | ||
component="div" | ||
gutterSize="l" | ||
justifyContent="flexStart" | ||
responsive={true} | ||
wrap={false} | ||
> | ||
<EuiFlexItem | ||
component="div" | ||
grow={false} | ||
> | ||
<img | ||
alt="" | ||
className="synopsisIcon" | ||
src="icon_url" | ||
/> | ||
</EuiFlexItem> | ||
<EuiFlexItem | ||
className="synopsisContent" | ||
component="div" | ||
grow={true} | ||
> | ||
<EuiTitle | ||
className="synopsisTitle" | ||
size="s" | ||
> | ||
<h4> | ||
Great tutorial | ||
</h4> | ||
</EuiTitle> | ||
<EuiText | ||
className="synopsisBody" | ||
> | ||
<p> | ||
<EuiTextColor | ||
color="subdued" | ||
> | ||
this is a great tutorial about... | ||
</EuiTextColor> | ||
</p> | ||
</EuiText> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
</a> | ||
`; | ||
|
||
exports[`render 1`] = ` | ||
<a | ||
className="euiLink synopsis" | ||
data-test-subj="homeSynopsisLinkgreat tutorial" | ||
href="link_to_item" | ||
> | ||
<EuiFlexGroup | ||
alignItems="stretch" | ||
component="div" | ||
gutterSize="l" | ||
justifyContent="flexStart" | ||
responsive={true} | ||
wrap={false} | ||
> | ||
<EuiFlexItem | ||
className="synopsisContent" | ||
component="div" | ||
grow={true} | ||
> | ||
<EuiTitle | ||
className="synopsisTitle" | ||
size="s" | ||
> | ||
<h4> | ||
Great tutorial | ||
</h4> | ||
</EuiTitle> | ||
<EuiText | ||
className="synopsisBody" | ||
> | ||
<p> | ||
<EuiTextColor | ||
color="subdued" | ||
> | ||
this is a great tutorial about... | ||
</EuiTextColor> | ||
</p> | ||
</EuiText> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
</a> | ||
`; |
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
35 changes: 35 additions & 0 deletions
35
src/core_plugins/kibana/public/home/components/synopsis.test.js
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,35 @@ | ||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
|
||
import { Synopsis } from './synopsis'; | ||
|
||
test('render', () => { | ||
const component = shallow(<Synopsis | ||
description="this is a great tutorial about..." | ||
title="Great tutorial" | ||
url="link_to_item" | ||
/>); | ||
expect(component).toMatchSnapshot(); // eslint-disable-line | ||
}); | ||
|
||
describe('props', () => { | ||
test('iconType', () => { | ||
const component = shallow(<Synopsis | ||
description="this is a great tutorial about..." | ||
title="Great tutorial" | ||
url="link_to_item" | ||
iconType="logoApache" | ||
/>); | ||
expect(component).toMatchSnapshot(); // eslint-disable-line | ||
}); | ||
|
||
test('iconUrl', () => { | ||
const component = shallow(<Synopsis | ||
description="this is a great tutorial about..." | ||
title="Great tutorial" | ||
url="link_to_item" | ||
iconUrl="icon_url" | ||
/>); | ||
expect(component).toMatchSnapshot(); // eslint-disable-line | ||
}); | ||
}); |
Oops, something went wrong.