1
0
mirror of https://github.com/yldio/copilot.git synced 2024-11-14 07:10:05 +02:00

Fixing <Close /> component`s requring of svg and adding to test file

This commit is contained in:
Alex Windett 2017-01-11 11:41:39 +00:00
parent 47869ef933
commit 62b7524e53
4 changed files with 32 additions and 5 deletions

View File

@ -1,6 +1,6 @@
const React = require('react'); const React = require('react');
const Styled = require('styled-components'); const Styled = require('styled-components');
const closeIcon = require('../../shared/assets/close.png');
const fns = require('../../shared/functions'); const fns = require('../../shared/functions');
const { const {
@ -30,7 +30,7 @@ const Close = ({
> >
<img <img
alt="Close" alt="Close"
src={closeIcon} src="./close.svg"
/> />
</StyledButton> </StyledButton>
); );

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="12px" height="12px" viewBox="0 0 12 12" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 41.2 (35397) - http://www.bohemiancoding.com/sketch -->
<title>icon: close</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="ui-components-revised" transform="translate(-3367.000000, -870.000000)" fill="#646464">
<g id="notifications" transform="translate(2457.000000, 72.000000)">
<g id="notification:-error" transform="translate(0.000000, 780.000000)">
<path d="M916.899495,22.8994949 L916.899495,16.8994949 L914.899495,16.8994949 L914.899495,22.8994949 L908.899495,22.8994949 L908.899495,24.8994949 L914.899495,24.8994949 L914.899495,30.8994949 L916.899495,30.8994949 L916.899495,24.8994949 L922.899495,24.8994949 L922.899495,22.8994949 L916.899495,22.8994949 Z" id="icon:-close" transform="translate(915.899495, 23.899495) rotate(45.000000) translate(-915.899495, -23.899495) "></path>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -56,8 +56,6 @@ const {
RadioGroup RadioGroup
} = require('../src/'); } = require('../src/');
const seed = require('./seed'); const seed = require('./seed');
const { const {
selectData selectData
@ -368,7 +366,14 @@ storiesOf('Tabs', module)
storiesOf('Close', module) storiesOf('Close', module)
.add('Default', () => ( .add('Default', () => (
<Base
style={{
position: 'relative',
width: 60
}}
>
<Close onClick={function noop() {}} /> <Close onClick={function noop() {}} />
</Base>
)); ));
storiesOf('Toggle', module) storiesOf('Toggle', module)

View File

@ -24,6 +24,12 @@ test('renders <Button> without exploding', (t) => {
t.deepEqual(wrapper.length, 1); t.deepEqual(wrapper.length, 1);
}); });
test('renders <Close> without exploding', (t) => {
const Close = require('../src/components/close');
const wrapper = shallow(<Close />);
t.deepEqual(wrapper.length, 1);
});
test('renders <Checkbox> without exploding', (t) => { test('renders <Checkbox> without exploding', (t) => {
const Checkbox = require('../src/components/checkbox'); const Checkbox = require('../src/components/checkbox');
const wrapper = shallow(<Checkbox />); const wrapper = shallow(<Checkbox />);