Skip to content

Commit

Permalink
Merge pull request mzabriskie#1 from schutterp/react-15
Browse files Browse the repository at this point in the history
upgrade peerDependencies to support react 15 and necessary accompanyi…
  • Loading branch information
chibicode authored Nov 14, 2016
2 parents 2bb1cce + 88ef5a2 commit 99ed371
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion examples/basic/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const App = React.createClass({
or the back, with `true` meaning show the back.
*/}
<FlipCard
disabled={true}
disabled
flipped={this.state.isFlipped}
onFlip={this.handleOnFlip}
onKeyDown={this.handleKeyDown}
Expand Down
17 changes: 9 additions & 8 deletions lib/components/__tests__/FlipCard-test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import ReactDOM from 'react-dom';
import TestUtils from 'react-addons-test-utils';
import FlipCard from '../../main';
import { equal, throws } from 'assert';
Expand All @@ -18,8 +19,8 @@ describe('react-flipcard', function() {
<div>bar</div>
</FlipCard>
);
equal(card.getDOMNode().classList.contains('ReactFlipCard--vertical'), true);
equal(card.getDOMNode().classList.contains('ReactFlipCard--horizontal'), false);
equal(ReactDOM.findDOMNode(card).classList.contains('ReactFlipCard--vertical'), true);
equal(ReactDOM.findDOMNode(card).classList.contains('ReactFlipCard--horizontal'), false);
});

it('should flip horizontally by default', function() {
Expand All @@ -29,8 +30,8 @@ describe('react-flipcard', function() {
<div>bar</div>
</FlipCard>
);
equal(card.getDOMNode().classList.contains('ReactFlipCard--vertical'), false);
equal(card.getDOMNode().classList.contains('ReactFlipCard--horizontal'), true);
equal(ReactDOM.findDOMNode(card).classList.contains('ReactFlipCard--vertical'), false);
equal(ReactDOM.findDOMNode(card).classList.contains('ReactFlipCard--horizontal'), true);
});

it('should default to enabled', function() {
Expand All @@ -40,17 +41,17 @@ describe('react-flipcard', function() {
<div>bar</div>
</FlipCard>
);
equal(card.getDOMNode().classList.contains('ReactFlipCard--enabled'), true);
equal(ReactDOM.findDOMNode(card).classList.contains('ReactFlipCard--enabled'), true);
});

it('should allow disabling', function() {
const card = TestUtils.renderIntoDocument(
<FlipCard disabled={true}>
<FlipCard disabled>
<div>foo</div>
<div>bar</div>
</FlipCard>
);
equal(card.getDOMNode().classList.contains('ReactFlipCard--enabled'), false);
equal(ReactDOM.findDOMNode(card).classList.contains('ReactFlipCard--enabled'), false);
});

// TODO: Why doesn't this work?
Expand All @@ -68,7 +69,7 @@ describe('react-flipcard', function() {
// </FlipCard>
// );
//
// card.getDOMNode().focus();
// ReactDOM.findDOMNode(card).focus();
// setTimeout(function () {
// ok(called);
// done();
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@
},
"homepage": "https://github.com/mzabriskie/react-flipcard",
"devDependencies": {
"rackt-cli": "^0.5.3",
"react": "^0.14.0",
"react-addons-test-utils": "^0.14.0",
"react-dom": "^0.14.0"
"rackt-cli": "^0.6.1",
"react": "^15.3.1",
"react-addons-test-utils": "^15.3.1",
"react-dom": "^15.3.1"
},
"peerDependencies": {
"react": "^0.14.0",
"react-dom": "^0.14.0"
"react": "^0.14.0 || ^15.0.0",
"react-dom": "^0.14.0 || ^15.0.0"
},
"dependencies": {
"classnames": "^2.2.0"
}
}
}

0 comments on commit 99ed371

Please sign in to comment.