8000 fix: fix tests, lint fixes, fix export · coreui/coreui-icons-react@0d96895 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0d96895

Browse files
committed
fix: fix tests, lint fixes, fix export
1 parent 07e31bc commit 0d96895

File tree

5 files changed

+22
-20
lines changed

5 files changed

+22
-20
lines changed

package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,19 @@
4545
"prop-types": "^15.7.2"
4646
},
4747
"peerDependencies": {
48-
"react": "^16.13.1",
49-
"react-dom": "^16.13.1"
48+
"react": "^16.13.1"
5049
},
5150
"devDependencies": {
5251
"babel-eslint": "^10.1.0",
5352
"enzyme": "^3.11.0",
5453
"enzyme-adapter-react-16": "^1.15.2",
55-
"eslint": "^6.8.0",
56-
"eslint-plugin-import": "^2.20.1",
57-
"eslint-plugin-react": "^7.19.0",
58-
"nwb": "^0.24.5",
59-
"sinon": "^5.1.1"
54+
"eslint": "^7.0.0",
55+
"eslint-plugin-import": "^2.20.2",
56+
"eslint-plugin-react": "^7.20.0",
57+
"react": "^16.13.1",
58+
"react-dom": "^16.13.1",
59+
"nwb": "^0.25.2",
60+
"sinon": "^9.0.2"
6061
},
6162
"keywords": [
6263
"coreui",

src/CIcon.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
import './CIcon.css'
2-
export { default as CIcon } from './CIconRaw'
2+
import CIcon from './CIconRaw'
3+
export default CIcon

src/CIconRaw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import classNames from 'classnames'
44

55
const colog = () => {
66
if (process && process.env && process.env.NODE_ENV === 'development') {
7-
console.log.apply(this, arguments);
7+
console.log.apply(this);
88
}
99
}
1010

tests/CIcon.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ import {CIcon} from 'src/'
66

77
describe('CIcon', () => {
88
it('renders svg with class="c-icon"', () => {
9-
expect(render(<CIcon></CIcon>))
9+
expect(render(<CIcon/>))
1010
.toContain('class="c-icon')
1111
})
1212
it('renders svg with class="c-icon-xl"', () => {
13-
expect(render(<CIcon size={'xl'}></CIcon>))
13+
expect(render(<CIcon size={'xl'}/>))
1414
.toContain(' c-icon-xl')
1515
})
1616
})

tests/CIconRaw.test.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,39 @@ React.icons = {logo, cilLogo};
88

99
describe('CIconRaw', () => {
1010
it('renders svg with class="c-icon"', () => {
11-
expect(render(<CIconRaw></CIconRaw>))
11+
expect(render(<CIconRaw/>))
1212
.toContain('class="c-icon')
1313
})
1414
it('renders svg with name', () => {
15-
expect(render(<CIconRaw name='logo'></CIconRaw>))
15+
expect(render(<CIconRaw name='logo'/>))
1616
.toContain(logo[1])
1717
})
1818
it('renders svg with name and className', () => {
19-
expect(render(<CIconRaw name={'logo'} className='test'></CIconRaw>))
19+
expect(render(<CIconRaw name={'logo'} className='test'/>))
2020
.toContain(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${logo[0]}" class="c-icon test" role="img">${logo[1]}</svg>`)
2121
})
2222
it('renders svg with content', () => {
23-
expect(render(<CIconRaw content='content'></CIconRaw>))
23+
expect(render(<CIconRaw content='content'/>))
2424
.toContain('role="img">content</svg>')
2525
})
2626
it('renders svg with size', () => {
27-
expect(render(<CIconRaw size='xl'></CIconRaw>))
27+
expect(render(<CIconRaw size='xl'/>))
2828
.toContain('c-icon-xl')
2929
})
3030
it('renders svg with custom size', () => {
31-
expect(render(<CIconRaw size='custom'></CIconRaw>))
31+
expect(render(<CIconRaw size='custom'/>))
3232
.toContain('c-icon-custom-size')
3333
})
3434
it('renders svg with className', () => {
35-
expect(render(<CIconRaw className='c-icon-test'></CIconRaw>))
35+
expect(render(<CIconRaw className='c-icon-test'/>))
3636
.toContain('c-icon-test')
3737
})
3838
it('renders <img> with src', () => {
39-
expect(render(<CIconRaw src='src'></CIconRaw>))
39+
expect(render(<CIconRaw src='src'/>))
4040
.toContain('<img src="src" role="img"/>')
4141
})
4242
it('renders <svg> with <use>', () => {
43-
expect(render(<CIconRaw use='xxx'></CIconRaw>))
43+
expect(render(<CIconRaw use='xxx'/>))
4444
.toContain('<use href="xxx"></use></svg>')
4545
})
4646
})

0 commit comments

Comments
 (0)
0