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

Removed some duplicate tests

These tests are duplicates of the same test in the same file. Copy/paste fail.

Sebastian Markbage committed Dec 23, 2014 at 13:56 UTC 8864692237158af13f1b677b009f74a003f90414
1 file changed -38
src/classic/class/__tests__/ReactClass-test.js
-38
@@ -15,14 +15,12 @@ var mocks = require('mocks');
15
16 var React;
17 var ReactTestUtils;
18 -var reactComponentExpect;
18
19 describe('ReactClass-spec', function() {
20
21 beforeEach(function() {
22 React = require('React');
23 ReactTestUtils = require('ReactTestUtils');
25 - reactComponentExpect = require('reactComponentExpect');
24 });
25
26 it('should throw when `render` is not specified', function() {
@@ -299,40 +297,4 @@ describe('ReactClass-spec', function() {
297 ).not.toThrow();
298 });
299
302 - it('should work with object getInitialState() return values', function() {
303 - var Component = React.createClass({
304 - getInitialState: function() {
305 - return {
306 - occupation: 'clown'
307 - };
308 - },
309 - render: function() {
310 - return <span />;
311 - }
312 - });
313 - var instance = <Component />;
314 - instance = ReactTestUtils.renderIntoDocument(instance);
315 - expect(instance.state.occupation).toEqual('clown');
316 - });
317 -
318 - it('should throw with non-object getInitialState() return values', function() {
319 - [['an array'], 'a string', 1234].forEach(function(state) {
320 - var Component = React.createClass({
321 - getInitialState: function() {
322 - return state;
323 - },
324 - render: function() {
325 - return <span />;
326 - }
327 - });
328 - var instance = <Component />;
329 - expect(function() {
330 - instance = ReactTestUtils.renderIntoDocument(instance);
331 - }).toThrow(
332 - 'Invariant Violation: Component.getInitialState(): ' +
333 - 'must return an object or null'
334 - );
335 - });
336 - });
337 -
300 });