Skip to content

Commit

Permalink
Basic test for constructor props
Browse files Browse the repository at this point in the history
  • Loading branch information
developit committed Dec 3, 2015
1 parent 43f696a commit 26847d4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/browser/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,13 @@ describe('render()', () => {

it('should render components with props', () => {
const PROPS = { foo:'bar', onBaz:()=>{} };
let constructorProps;

class C2 extends Component {
constructor(props) {
super(props);
constructorProps = props;
}
render(props) {
return <div {...props} />;
}
Expand All @@ -184,6 +189,8 @@ describe('render()', () => {

render(<C2 {...PROPS} />, scratch);

expect(constructorProps).to.deep.equal(PROPS);

expect(C2.prototype.render)
.to.have.been.calledOnce
.and.to.have.been.calledWithMatch(PROPS, {})
Expand Down

0 comments on commit 26847d4

Please sign in to comment.