@@ -4,6 +4,7 @@ import {render, mount, behavesAsComponent, checkExports} from '../utils/testing'
44import { render as HTMLRender , cleanup } from '@testing-library/react'
55import { axe , toHaveNoViolations } from 'jest-axe'
66import 'babel-polyfill'
7+ import { SearchIcon } from '@primer/octicons-react'
78expect . extend ( toHaveNoViolations )
89
910describe ( 'TextInput' , ( ) => {
@@ -25,17 +26,41 @@ describe('TextInput', () => {
2526 } )
2627
2728 it ( 'renders small' , ( ) => {
28- expect ( render ( < TextInput name = "zipcode" variant = "small" /> ) ) . toMatchSnapshot ( )
29+ expect ( render ( < TextInput name = "zipcode" size = "small" /> ) ) . toMatchSnapshot ( )
2930 } )
3031
3132 it ( 'renders large' , ( ) => {
32- expect ( render ( < TextInput name = "zipcode" variant = "large" /> ) ) . toMatchSnapshot ( )
33+ expect ( render ( < TextInput name = "zipcode" size = "large" /> ) ) . toMatchSnapshot ( )
3334 } )
3435
3536 it ( 'renders block' , ( ) => {
3637 expect ( render ( < TextInput name = "zipcode" block /> ) ) . toMatchSnapshot ( )
3738 } )
3839
40+ it ( 'renders warning' , ( ) => {
41+ expect ( render ( < TextInput name = "zipcode" status = "warning" /> ) ) . toMatchSnapshot ( )
42+ } )
43+
44+ it ( 'renders error' , ( ) => {
45+ expect ( render ( < TextInput name = "zipcode" status = "error" /> ) ) . toMatchSnapshot ( )
46+ } )
47+
48+ it ( 'renders contrast' , ( ) => {
49+ expect ( render ( < TextInput name = "zipcode" status = "contrast" /> ) ) . toMatchSnapshot ( )
50+ } )
51+
52+ it ( 'renders placeholder' , ( ) => {
53+ expect ( render ( < TextInput name = "zipcode" placeholder = { '560076' } /> ) ) . toMatchSnapshot ( )
54+ } )
55+
56+ it ( 'renders leadingIcon' , ( ) => {
57+ expect ( render ( < TextInput name = "search" placeholder = { 'Search' } leadingIcon = { SearchIcon } /> ) ) . toMatchSnapshot ( )
58+ } )
59+
60+ it ( 'renders trailingIcon' , ( ) => {
61+ expect ( render ( < TextInput name = "search" placeholder = { 'Search' } trailingIcon = { SearchIcon } /> ) ) . toMatchSnapshot ( )
62+ } )
63+
3964 it ( 'should call onChange prop with input value' , ( ) => {
4065 const onChangeMock = jest . fn ( )
4166 const component = mount ( < TextInput onChange = { onChangeMock } value = "test" /> )
0 commit comments