Skip to content

Commit

Permalink
Just use jsdom, for now
Browse files Browse the repository at this point in the history
  • Loading branch information
acdlite committed Jun 12, 2015
1 parent 3d18a55 commit 1dffe78
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
"eslint-plugin-react": "^2.3.0",
"expect": "^1.6.0",
"istanbul": "^0.3.15",
"jsdom": "~5.4.3",
"mocha": "^2.2.5",
"mocha-jsdom": "~0.4.0",
"react": "^0.13.0",
"react-hot-loader": "^1.2.7",
"rimraf": "^2.3.4",
Expand Down
17 changes: 9 additions & 8 deletions test/components/Provider.spec.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import expect from 'expect';
import React, { PropTypes } from 'react/addons';
import jsdom from 'mocha-jsdom';
import React, { PropTypes, Component } from 'react/addons';
import { createRedux } from '../../src';
import { Provider } from '../../src/react';

const { TestUtils } = React.addons;
const renderer = TestUtils.createRenderer();

describe('React', () => {
describe('Provider', () => {
it.skip('adds Redux to child context', () => {
jsdom();

it('adds Redux to child context', () => {
const redux = createRedux({ test: () => 'test' });

class Child {
class Child extends Component {
static contextTypes = {
redux: PropTypes.object.isRequired
}
Expand All @@ -21,15 +23,14 @@ describe('React', () => {
}
}

renderer.render(
const tree = TestUtils.renderIntoDocument(
<Provider redux={redux}>
{() => <Child />}
</Provider>
);

const result = renderer.getRenderOutput();

expect(result.type).toBe(Child);
const child = TestUtils.findRenderedComponentWithType(tree, Child);
expect(child.context.redux).toBe(redux);
});
});
});

0 comments on commit 1dffe78

Please sign in to comment.