Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add list style component * Add list component to index * Add tests for ListStyle * update readme with list component
- Loading branch information
Showing
4 changed files
with
64 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from 'react' | ||
import Wrap from '../Wrap' | ||
|
||
const ListStyle = (props) => { | ||
return ( | ||
<Wrap {...props}> | ||
<rect x="0" y="0" rx="3" ry="3" width="250" height="10" /> | ||
<rect x="20" y="20" rx="3" ry="3" width="220" height="10" /> | ||
<rect x="20" y="40" rx="3" ry="3" width="170" height="10" /> | ||
<rect x="0" y="60" rx="3" ry="3" width="250" height="10" /> | ||
<rect x="20" y="80" rx="3" ry="3" width="200" height="10" /> | ||
<rect x="20" y="100" rx="3" ry="3" width="80" height="10" /> | ||
</Wrap> | ||
) | ||
} | ||
|
||
export default ListStyle |
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,37 @@ | ||
import React from 'react' | ||
|
||
import {mount, render} from 'enzyme' | ||
import chai, {expect} from 'chai' | ||
import chaiEnzyme from 'chai-enzyme' | ||
import sinon from 'sinon' | ||
|
||
chai.use(chaiEnzyme()) | ||
|
||
import ListStyle from '../../src/stylized/ListStyle' | ||
|
||
describe('<ListStyle />', () => { | ||
it('has a `svg`', () => { | ||
const wrapper = render(<ListStyle />) | ||
expect(wrapper.find('svg')).to.have.length(1) | ||
}) | ||
|
||
it('has a `rect` with `clip-path`', () => { | ||
const wrapper = render(<ListStyle />) | ||
expect(wrapper.find('rect[clip-path]')).to.have.length(1) | ||
}) | ||
|
||
it('has a `linearGradient`', () => { | ||
const wrapper = render(<ListStyle />) | ||
expect(wrapper.find('linearGradient')).to.have.length(1) | ||
}) | ||
|
||
it('has three `stop`', () => { | ||
const wrapper = render(<ListStyle />) | ||
expect(wrapper.find('stop')).to.have.length(3) | ||
}) | ||
|
||
it('has `stop` inside the `linearGradient`', () => { | ||
const wrapper = render(<ListStyle />) | ||
expect(wrapper.find('stop').parent().is('lineargradient')).to.equal(true) | ||
}) | ||
}) |