Skip to content

Commit

Permalink
CR Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Intregrisist committed Feb 18, 2018
1 parent 4ded8d8 commit a28a0aa
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions test/specs/elements/Input/Input-test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react'

import Input from 'src/elements/Input/Input'
import Icon from 'src/elements/Icon/Icon'
import { htmlInputProps, SUI } from 'src/lib'
import * as common from 'test/specs/commonTests'
import { sandbox } from 'test/utils'
Expand Down Expand Up @@ -259,4 +260,46 @@ describe('Input', () => {
.should.have.prop('tabIndex', 123)
})
})

describe('icon', () => {
it('is not first child', () => {
shallow(<Input icon='search' />)
.children()
.first()
.is(Icon)
.should.not.be.true()
})

it('is not first child with action positioned left', () => {
shallow(<Input icon='search' action='foo' actionPosition='left' />)
.children()
.first()
.is(Icon)
.should.not.be.true()
})

it('is not first child with label', () => {
shallow(<Input icon='search' label='foo' />)
.children()
.first()
.is(Icon)
.should.not.be.true()
})

it('is not last child if contains action', () => {
shallow(<Input icon='search' iconPosition='left' action='foo' />)
.children()
.last()
.is(Icon)
.should.not.be.true()
})

it('is not last child if contains label positioned right', () => {
shallow(<Input icon='search' iconPosition='left' label='foo' labelPosition='right' />)
.children()
.last()
.is(Icon)
.should.not.be.true()
})
})
})

0 comments on commit a28a0aa

Please sign in to comment.