Skip to content

Commit

Permalink
fix(490): Put build dependencies to devDependencies (#491)
Browse files Browse the repository at this point in the history
lint / build dependencies incorrectly marked as `dependencies`

closes #490
  • Loading branch information
SaraVieira authored and okonet committed Sep 6, 2017
1 parent a5471a5 commit dccb796
Show file tree
Hide file tree
Showing 5 changed files with 449 additions and 362 deletions.
1 change: 1 addition & 0 deletions .eslintrc
Expand Up @@ -17,6 +17,7 @@
]
}
],
"react/require-default-props": 0,

// Import
"import/no-extraneous-dependencies": [
Expand Down
34 changes: 17 additions & 17 deletions package.json
Expand Up @@ -58,41 +58,41 @@
},
"dependencies": {
"attr-accept": "^1.0.3",
"babel-preset-env": "^1.6.0",
"babel-preset-stage-1": "^6.24.1",
"eslint-config-prettier": "^2.3.0",
"eslint-plugin-prettier": "^2.2.0",
"prop-types": "^15.5.7"
},
"devDependencies": {
"@commitlint/cli": "^3.0.3",
"@commitlint/cli": "^3.2.0",
"@commitlint/config-angular": "^3.0.3",
"@commitlint/prompt": "^3.1.2",
"@commitlint/prompt-cli": "^3.0.3",
"@commitlint/prompt": "^3.2.0",
"@commitlint/prompt-cli": "^3.2.0",
"babel-cli": "^6.9.0",
"babel-core": "^6.9.1",
"babel-eslint": "^7.1.1",
"babel-jest": "^20.0.3",
"babel-loader": "^7.1.1",
"babel-jest": "^21.0.0",
"babel-loader": "^7.1.2",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-preset-env": "^1.6.0",
"babel-preset-react": "^6.3.13",
"babel-preset-stage-1": "^6.24.1",
"babel-register": "^6.9.0",
"commitizen": "^2.9.6",
"css-loader": "^0.28.1",
"css-loader": "^0.28.7",
"enzyme": "^2.6.0",
"eslint": "^4.4.1",
"eslint-config-okonet": "^4.0.2",
"eslint": "^4.6.1",
"eslint-config-okonet": "^5.0.1",
"eslint-config-prettier": "^2.4.0",
"eslint-plugin-prettier": "^2.2.0",
"husky": "^0.14.3",
"imagemin-cli": "^3.0.0",
"imagemin-pngquant": "^5.0.0",
"jest": "^20.0.1",
"jest-enzyme": "^3.2.0",
"lint-staged": "^4.0.0",
"jest": "^21.0.1",
"jest-enzyme": "^3.8.2",
"lint-staged": "^4.1.0",
"markdownlint-cli": "^0.3.1",
"prettier": "^1.3.1",
"prettier": "^1.6.1",
"react": "^15.4.1",
"react-dom": "^15.4.1",
"react-styleguidist": "^6.0.15",
"react-styleguidist": "^6.0.23",
"react-test-renderer": "^15.6.1",
"rimraf": "^2.5.2",
"semantic-release": "^7.0.2",
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Expand Up @@ -415,7 +415,7 @@ export default Dropzone
Dropzone.propTypes = {
/**
* Allow specific types of files. See https://github.com/okonet/attr-accept for more information.
* Keep in mind that mime type determination is not reliable accross platforms. CSV files,
* Keep in mind that mime type determination is not reliable across platforms. CSV files,
* for example, are reported as text/plain under macOS but as application/vnd.ms-excel under
* Windows. In some cases there might not be a mime type set at all.
* See: https://github.com/react-dropzone/react-dropzone/issues/276
Expand Down
50 changes: 25 additions & 25 deletions src/index.spec.js
Expand Up @@ -99,16 +99,8 @@ describe('Dropzone', () => {

it('should render children function', () => {
const content = <p>some content</p>
const dropzone = mount(
<Dropzone>
{content}
</Dropzone>
)
const dropzoneWithFunction = mount(
<Dropzone>
{() => content}
</Dropzone>
)
const dropzone = mount(<Dropzone>{content}</Dropzone>)
const dropzoneWithFunction = mount(<Dropzone>{() => content}</Dropzone>)
expect(dropzoneWithFunction.html()).toEqual(dropzone.html())
})
})
Expand Down Expand Up @@ -224,10 +216,25 @@ describe('Dropzone', () => {

it('should reset the value of input', () => {
const dropzone = mount(<Dropzone />)
expect(dropzone.render().find('input').attr('value')).toBeUndefined()
expect(dropzone.render().find('input').attr('value', 10)).not.toBeUndefined()
expect(
dropzone
.render()
.find('input')
.attr('value')
).toBeUndefined()
expect(
dropzone
.render()
.find('input')
.attr('value', 10)
).not.toBeUndefined()
dropzone.simulate('click')
expect(dropzone.render().find('input').attr('value')).toBeUndefined()
expect(
dropzone
.render()
.find('input')
.attr('value')
).toBeUndefined()
})

it('should trigger click even on the input', done => {
Expand Down Expand Up @@ -355,11 +362,7 @@ describe('Dropzone', () => {
})

it('should set proper dragActive state on dragEnter', () => {
const dropzone = mount(
<Dropzone>
{props => <DummyChildComponent {...props} />}
</Dropzone>
)
const dropzone = mount(<Dropzone>{props => <DummyChildComponent {...props} />}</Dropzone>)
const child = dropzone.find(DummyChildComponent)
dropzone.simulate('dragEnter', { dataTransfer: { files } })
expect(child).toHaveProp('isDragActive', true)
Expand All @@ -369,9 +372,7 @@ describe('Dropzone', () => {

it('should set proper dragReject state on dragEnter', () => {
const dropzone = mount(
<Dropzone accept="image/*">
{props => <DummyChildComponent {...props} />}
</Dropzone>
<Dropzone accept="image/*">{props => <DummyChildComponent {...props} />}</Dropzone>
)
const child = dropzone.find(DummyChildComponent)
dropzone.simulate('dragEnter', {
Expand Down Expand Up @@ -462,9 +463,7 @@ describe('Dropzone', () => {

it('should set proper dragActive state if accept prop changes mid-drag', () => {
const dropzone = mount(
<Dropzone accept="image/*">
{props => <DummyChildComponent {...props} />}
</Dropzone>
<Dropzone accept="image/*">{props => <DummyChildComponent {...props} />}</Dropzone>
)
const child = dropzone.find(DummyChildComponent)
dropzone.simulate('dragEnter', { dataTransfer: { files: images } })
Expand Down Expand Up @@ -942,7 +941,7 @@ describe('Dropzone', () => {

const InnerDragAccepted = () => <p>Accepted</p>
const InnerDragRejected = () => <p>Rejected</p>
const InnerDropzone = () =>
const InnerDropzone = () => (
<Dropzone
onDrop={innerDropSpy}
onDropAccepted={innerDropAcceptedSpy}
Expand All @@ -955,6 +954,7 @@ describe('Dropzone', () => {
return <p>No drag</p>
}}
</Dropzone>
)

describe('dropping on the inner dropzone', () => {
it('mounts both dropzones', () => {
Expand Down

0 comments on commit dccb796

Please sign in to comment.