This repository has been archived by the owner on Oct 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
569 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"env": { | ||
"node": true, | ||
"jest": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from 'react'; | ||
import renderer from 'react-test-renderer'; | ||
import Autocomplete from '../src/Autocomplete'; | ||
|
||
describe('Autocomplete', () => { | ||
it('renders correctly with function child', () => { | ||
const tree = renderer.create( | ||
<Autocomplete value='test' options={['test1', 'test2']}> | ||
{props => <input {...props} />} | ||
</Autocomplete> | ||
).toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
|
||
it('renders correctly with element child', () => { | ||
const tree = renderer.create( | ||
<Autocomplete value='test' options={['test1', 'test2']}> | ||
<input /> | ||
</Autocomplete> | ||
).toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from 'react'; | ||
import renderer from 'react-test-renderer'; | ||
import Autosize from '../src/Autosize'; | ||
|
||
describe('Autosize', () => { | ||
it('renders correctly with function child', () => { | ||
const tree = renderer.create( | ||
<Autosize value='test'> | ||
{props => <input {...props} />} | ||
</Autosize> | ||
).toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
|
||
it('renders correctly with element child', () => { | ||
const tree = renderer.create( | ||
<Autosize value='test'> | ||
<input /> | ||
</Autosize> | ||
).toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from 'react'; | ||
import renderer from 'react-test-renderer'; | ||
import Combobox from '../src/Combobox'; | ||
|
||
describe('Combobox', () => { | ||
it('renders correctly with function child', () => { | ||
const tree = renderer.create( | ||
<Combobox value='test' options={['test1', 'test2']} autosize autocomplete> | ||
{props => <input {...props} />} | ||
</Combobox> | ||
).toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
|
||
it('renders correctly with element child', () => { | ||
const tree = renderer.create( | ||
<Combobox value='test' options={['test1', 'test2']} autosize autocomplete> | ||
<input /> | ||
</Combobox> | ||
).toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React from 'react'; | ||
import renderer from 'react-test-renderer'; | ||
import DatePicker from '../src/DatePicker'; | ||
import moment from 'moment'; | ||
|
||
const now = moment(0); | ||
|
||
describe('DatePicker', () => { | ||
it('renders correctly with function child', () => { | ||
const tree = renderer.create( | ||
<DatePicker | ||
value={now.format('ddd DD/MM/YYYY')} | ||
> | ||
{props => <input {...props} />} | ||
</DatePicker> | ||
).toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
|
||
it('renders correctly with element child', () => { | ||
const tree = renderer.create( | ||
<DatePicker | ||
value={now.format('ddd DD/MM/YYYY')} | ||
> | ||
<input /> | ||
</DatePicker> | ||
).toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from 'react'; | ||
import renderer from 'react-test-renderer'; | ||
import Dropdown from '../src/Dropdown'; | ||
|
||
describe('Dropdown', () => { | ||
it('renders correctly with function child', () => { | ||
const tree = renderer.create( | ||
<Dropdown value='test' options={['test1', 'test2']}> | ||
{props => <input {...props} />} | ||
</Dropdown> | ||
).toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
|
||
it('renders correctly with element child', () => { | ||
const tree = renderer.create( | ||
<Dropdown value='test' options={['test1', 'test2']}> | ||
<input /> | ||
</Dropdown> | ||
).toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from 'react'; | ||
import renderer from 'react-test-renderer'; | ||
import Mask from '../src/Mask'; | ||
|
||
describe('Mask', () => { | ||
it('renders correctly with function child', () => { | ||
const tree = renderer.create( | ||
<Mask value='123' pattern='0-0-0'> | ||
{props => <input {...props} />} | ||
</Mask> | ||
).toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
|
||
it('renders correctly with element child', () => { | ||
const tree = renderer.create( | ||
<Mask value='123' pattern='0-0-0'> | ||
<input /> | ||
</Mask> | ||
).toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
exports[`Autocomplete renders correctly with element child 1`] = ` | ||
<input | ||
onChange={[Function anonymous]} | ||
onKeyDown={[Function anonymous]} | ||
value="test" /> | ||
`; | ||
|
||
exports[`Autocomplete renders correctly with function child 1`] = ` | ||
<input | ||
onChange={[Function anonymous]} | ||
onKeyDown={[Function anonymous]} | ||
value="test" /> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
exports[`Autosize renders correctly with element child 1`] = ` | ||
<input | ||
onChange={[Function anonymous]} | ||
placeholder={undefined} | ||
style={Object {}} | ||
value="test" /> | ||
`; | ||
|
||
exports[`Autosize renders correctly with function child 1`] = ` | ||
<input | ||
onChange={[Function anonymous]} | ||
placeholder={undefined} | ||
style={Object {}} | ||
value="test" /> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
exports[`Combobox renders correctly with element child 1`] = ` | ||
<div | ||
onBlur={[Function anonymous]} | ||
onFocus={[Function anonymous]} | ||
style={ | ||
Object { | ||
"display": "inline-block", | ||
"position": "relative" | ||
} | ||
}> | ||
<input | ||
onBlur={undefined} | ||
onChange={[Function anonymous]} | ||
onFocus={undefined} | ||
onInput={undefined} | ||
onKeyDown={[Function anonymous]} | ||
onMouseEnter={[Function anonymous]} | ||
onMouseLeave={[Function anonymous]} | ||
placeholder={undefined} | ||
style={Object {}} | ||
value="test1" /> | ||
<div | ||
style={ | ||
Object { | ||
"paddingLeft": "3px", | ||
"paddingTop": "5px", | ||
"position": "absolute", | ||
"right": "5px", | ||
"top": 0, | ||
"verticalAlign": "middle", | ||
"width": "10px" | ||
} | ||
}> | ||
<svg | ||
fill="currentColor" | ||
height="5" | ||
style={ | ||
Object { | ||
"display": "inline-block", | ||
"opacity": 0, | ||
"transform": "translateY(5px)", | ||
"transition": "opacity 0.15s linear, transform 0.15s linear" | ||
} | ||
} | ||
width="10"> | ||
<path | ||
d="M0 0 H10 L5 5 z" /> | ||
</svg> | ||
</div> | ||
</div> | ||
`; | ||
|
||
exports[`Combobox renders correctly with function child 1`] = ` | ||
<div | ||
onBlur={[Function anonymous]} | ||
onFocus={[Function anonymous]} | ||
style={ | ||
Object { | ||
"display": "inline-block", | ||
"position": "relative" | ||
} | ||
}> | ||
<input | ||
onBlur={undefined} | ||
onChange={[Function anonymous]} | ||
onFocus={undefined} | ||
onInput={undefined} | ||
onKeyDown={[Function anonymous]} | ||
onMouseEnter={[Function anonymous]} | ||
onMouseLeave={[Function anonymous]} | ||
placeholder={undefined} | ||
style={Object {}} | ||
value="test1" /> | ||
<div | ||
style={ | ||
Object { | ||
"paddingLeft": "3px", | ||
"paddingTop": "5px", | ||
"position": "absolute", | ||
"right": "5px", | ||
"top": 0, | ||
"verticalAlign": "middle", | ||
"width": "10px" | ||
} | ||
}> | ||
<svg | ||
fill="currentColor" | ||
height="5" | ||
style={ | ||
Object { | ||
"display": "inline-block", | ||
"opacity": 0, | ||
"transform": "translateY(5px)", | ||
"transition": "opacity 0.15s linear, transform 0.15s linear" | ||
} | ||
} | ||
width="10"> | ||
<path | ||
d="M0 0 H10 L5 5 z" /> | ||
</svg> | ||
</div> | ||
</div> | ||
`; |
Oops, something went wrong.