From 86c0b69390e684e182728f0051a24f4a58e8a207 Mon Sep 17 00:00:00 2001 From: Cheng Lou Date: Mon, 12 Aug 2013 16:52:49 -0400 Subject: [PATCH] separate new tests into respective file --- .../__tests__/ReactDOMInput-test.js | 55 +++++++++++++++++++ .../__tests__/ReactDOMTextarea-test.js | 33 ----------- 2 files changed, 55 insertions(+), 33 deletions(-) create mode 100644 src/dom/components/__tests__/ReactDOMInput-test.js diff --git a/src/dom/components/__tests__/ReactDOMInput-test.js b/src/dom/components/__tests__/ReactDOMInput-test.js new file mode 100644 index 0000000000..877b400080 --- /dev/null +++ b/src/dom/components/__tests__/ReactDOMInput-test.js @@ -0,0 +1,55 @@ +/** + * Copyright 2013 Facebook, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @jsx React.DOM + * @emails react-core + */ + +"use strict"; + +/*jshint evil:true */ + +describe('ReactDOMInput', function() { + var React; + var ReactTestUtils; + + var renderTextInput; + + beforeEach(function() { + React = require('React'); + ReactTestUtils = require('ReactTestUtils'); + + renderTextInput = function(component) { + var stub = ReactTestUtils.renderIntoDocument(component); + var node = stub.getDOMNode(); + return node; + }; + }); + + it('should display `defaultValue` of number 0', function() { + var stub = ; + var node = renderTextInput(stub); + + expect(node.value).toBe('0'); + }); + + it('should display `value` of number 0', function() { + var stub = ; + var node = renderTextInput(stub); + + expect(node.value).toBe('0'); + }); + +}); diff --git a/src/dom/components/__tests__/ReactDOMTextarea-test.js b/src/dom/components/__tests__/ReactDOMTextarea-test.js index 4e3d44fa60..d4a35014fe 100644 --- a/src/dom/components/__tests__/ReactDOMTextarea-test.js +++ b/src/dom/components/__tests__/ReactDOMTextarea-test.js @@ -116,36 +116,3 @@ describe('ReactDOMTextarea', function() { expect(console.warn.argsForCall.length).toBe(2); }); }); - -describe('ReactDOMInput', function() { - var React; - var ReactTestUtils; - - var renderTextarea; - - beforeEach(function() { - React = require('React'); - ReactTestUtils = require('ReactTestUtils'); - - renderTextarea = function(component) { - var stub = ReactTestUtils.renderIntoDocument(component); - var node = stub.getDOMNode(); - return node; - }; - }); - - it('should display `defaultValue` of number 0', function() { - var stub = ; - var node = renderTextarea(stub); - - expect(node.value).toBe('0'); - }); - - it('should display `value` of number 0', function() { - var stub = ; - var node = renderTextarea(stub); - - expect(node.value).toBe('0'); - }); - -});