@samitouri / QOS-React-2 / commits / 2d1a24e8df

Add missing super() calls

Babel complains without these because it's invalid ES6.

Ben Alpert committed Apr 24, 2015 at 16:16 UTC 2d1a24e8dfb18359a1b0d9b626b10855fb8d8897
1 file changed +7
src/modern/class/__tests__/ReactES6Class-test.js
+7
@@ -81,6 +81,7 @@ describe('ReactES6Class', function() {
81 it('renders based on state using props in the constructor', function() {
82 class Foo extends React.Component {
83 constructor(props) {
84 + super(props);
85 this.state = {bar: props.initialValue};
86 }
87 changeState() {
@@ -133,6 +134,7 @@ describe('ReactES6Class', function() {
134 var renderCount = 0;
135 class Foo extends React.Component {
136 constructor(props) {
137 + super(props);
138 this.state = {bar: props.initialValue};
139 }
140 componentWillMount() {
@@ -167,6 +169,7 @@ describe('ReactES6Class', function() {
169 it('should render with null in the initial state property', function() {
170 class Foo extends React.Component {
171 constructor() {
172 + super();
173 this.state = null;
174 }
175 render() {
@@ -179,6 +182,7 @@ describe('ReactES6Class', function() {
182 it('setState through an event handler', function() {
183 class Foo extends React.Component {
184 constructor(props) {
185 + super(props);
186 this.state = {bar: props.initialValue};
187 }
188 handleClick() {
@@ -201,6 +205,7 @@ describe('ReactES6Class', function() {
205 it('should not implicitly bind event handlers', function() {
206 class Foo extends React.Component {
207 constructor(props) {
208 + super(props);
209 this.state = {bar: props.initialValue};
210 }
211 handleClick() {
@@ -222,6 +227,7 @@ describe('ReactES6Class', function() {
227 it('renders using forceUpdate even when there is no state', function() {
228 class Foo extends React.Component {
229 constructor(props) {
230 + super(props);
231 this.mutativeValue = props.initialValue;
232 }
233 handleClick() {
@@ -301,6 +307,7 @@ describe('ReactES6Class', function() {
307 var getInitialStateWasCalled = false;
308 class Foo extends React.Component {
309 constructor() {
310 + super();
311 this.contextTypes = {};
312 this.propTypes = {};
313 }