Skip to content

Commit

Permalink
a bunch of little crappy tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jwietelmann committed Dec 19, 2016
1 parent 70ff2a0 commit d4df6a9
Show file tree
Hide file tree
Showing 6 changed files with 144 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/Checkbox.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,26 @@ describe('Checkbox', () => {
expect(childClassName).to.contain(testClassName)
})
})

describe('Checkbox.Fieldset', () => {
const options = [
{label: 'Left', value: 'L'},
{label: 'Right', value: 'R'},
]

it('should render without throwing', () => {
shallow(<Checkbox.Fieldset options={options} />)
})

it('should add className to child', () => {
const testClassName = '__TEST__'

const childClassName = shallow(
<Checkbox.Fieldset className={testClassName} options={options} />
)
.first()
.prop('className')

expect(childClassName).to.contain(testClassName)
})
})
33 changes: 33 additions & 0 deletions src/FileInput.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import FileInput from './FileInput'

describe('FileInput', () => {
it('should render without throwing', () => {
shallow(<FileInput />)
})

it('should add className to child', () => {
const testClassName = '__TEST__'

const childClassName = shallow(<FileInput className={testClassName} />)
.first()
.prop('className')

expect(childClassName).to.contain(testClassName)
})
})

describe('FileInput.Stack', () => {
it('should render without throwing', () => {
shallow(<FileInput.Stack />)
})

it('should add className to child', () => {
const testClassName = '__TEST__'

const childClassName = shallow(<FileInput.Stack className={testClassName} />)
.first()
.prop('className')

expect(childClassName).to.contain(testClassName)
})
})
16 changes: 16 additions & 0 deletions src/Input.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,19 @@ describe('Input', () => {
expect(childClassName).to.contain(testClassName)
})
})

describe('Input.Stack', () => {
it('should render without throwing', () => {
shallow(<Input.Stack />)
})

it('should add className to child', () => {
const testClassName = '__TEST__'

const childClassName = shallow(<Input.Stack className={testClassName} />)
.first()
.prop('className')

expect(childClassName).to.contain(testClassName)
})
})
23 changes: 23 additions & 0 deletions src/Radio.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,26 @@ describe('Radio', () => {
expect(childClassName).to.contain(testClassName)
})
})

describe('Radio.Fieldset', () => {
const options = [
{label: 'Left', value: 'L'},
{label: 'Right', value: 'R'},
]

it('should render without throwing', () => {
shallow(<Radio.Fieldset options={options} />)
})

it('should add className to child', () => {
const testClassName = '__TEST__'

const childClassName = shallow(
<Radio.Fieldset className={testClassName} options={options} />
)
.first()
.prop('className')

expect(childClassName).to.contain(testClassName)
})
})
16 changes: 16 additions & 0 deletions src/Select.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,19 @@ describe('Select', () => {
expect(childClassName).to.contain(testClassName)
})
})

describe('Select.Stack', () => {
it('should render without throwing', () => {
shallow(<Select.Stack />)
})

it('should add className to child', () => {
const testClassName = '__TEST__'

const childClassName = shallow(<Select.Stack className={testClassName} />)
.first()
.prop('className')

expect(childClassName).to.contain(testClassName)
})
})
33 changes: 33 additions & 0 deletions src/Textarea.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import Textarea from './Textarea'

describe('Textarea', () => {
it('should render without throwing', () => {
shallow(<Textarea />)
})

it('should add className to child', () => {
const testClassName = '__TEST__'

const childClassName = shallow(<Textarea className={testClassName} />)
.first()
.prop('className')

expect(childClassName).to.contain(testClassName)
})
})

describe('Textarea.Stack', () => {
it('should render without throwing', () => {
shallow(<Textarea.Stack />)
})

it('should add className to child', () => {
const testClassName = '__TEST__'

const childClassName = shallow(<Textarea.Stack className={testClassName} />)
.first()
.prop('className')

expect(childClassName).to.contain(testClassName)
})
})

0 comments on commit d4df6a9

Please sign in to comment.