Skip to content

Commit

Permalink
refactor(Textarea): rename TextArea, add doc block (#409)
Browse files Browse the repository at this point in the history
  • Loading branch information
levithomason committed Aug 21, 2016
1 parent fa204d9 commit 646d3af
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 27 deletions.
18 changes: 18 additions & 0 deletions src/addons/TextArea/TextArea.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react'
import { META } from '../../lib'

/**
* A simple <textarea> wrapper for use in Form.TextArea.
* We may add more features to the TextArea in the future.
* @see Form
*/
function TextArea(props) {
return <textarea {...props} />
}

TextArea._meta = {
name: 'TextArea',
type: META.TYPES.ADDON,
}

export default TextArea
20 changes: 0 additions & 20 deletions src/addons/Textarea/Textarea.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/addons/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { default as Confirm } from './Confirm/Confirm'
export { default as Radio } from './Radio/Radio'
export { default as Select } from './Select/Select'
export { default as Textarea } from './Textarea/Textarea'
export { default as TextArea } from './TextArea/TextArea'
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from 'react'

import Textarea from 'src/addons/Textarea/Textarea'
import TextArea from 'src/addons/TextArea/TextArea'
import * as common from '../commonTests'

describe('Textarea', () => {
common.isConformant(Textarea)
describe('TextArea', () => {
common.isConformant(TextArea)

it('accepts a default value', () => {
const wrapper = mount(<Textarea defaultValue='Hello World' />)
const wrapper = mount(<TextArea defaultValue='Hello World' />)

wrapper
.should.have.have.exactly(1).descendants('textarea')
Expand All @@ -17,12 +17,12 @@ describe('Textarea', () => {
})

it('has a name assigned', () => {
shallow(<Textarea name='sample-post' />)
shallow(<TextArea name='sample-post' />)
.should.have.prop('name', 'sample-post')
})

it('has assigned amount of rows', () => {
shallow(<Textarea rows='6' />)
shallow(<TextArea rows='6' />)
.should.have.tagName('textarea')
.with.attr('rows', '6')
})
Expand Down

0 comments on commit 646d3af

Please sign in to comment.