-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #61 from catho/ISSUE-58
[ISSUE-58] - Input: Implements a callback on cancel icon
- Loading branch information
Showing
9 changed files
with
995 additions
and
1,149 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
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
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
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,35 @@ | ||
import React from 'react'; | ||
import renderer from 'react-test-renderer'; | ||
import Input from './Input'; | ||
|
||
jest.mock('react-text-mask', () => props => ( | ||
<input type="text" {...{ ...props }} /> | ||
)); | ||
|
||
describe('Input component', () => { | ||
it('should match snapshots', () => { | ||
const INPUTS = [ | ||
<Input />, | ||
<Input value="foo" />, | ||
<Input label="Text label" />, | ||
<Input error="Error message" />, | ||
<Input required />, | ||
<Input type="search" />, | ||
<Input disabled />, | ||
<Input helperText="this is a helper text" />, | ||
<Input descriptionLabel="this is a description label" />, | ||
<Input descriptionLabel="this is a description label" type="search" />, | ||
<Input placeholder="this input has a placeholder" />, | ||
<Input.CEP />, | ||
<Input.CNPJ />, | ||
<Input.CPF />, | ||
<Input.Date />, | ||
<Input.Phone />, | ||
<Input.Password />, | ||
]; | ||
|
||
INPUTS.forEach(input => | ||
expect(renderer.create(input).toJSON()).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
Oops, something went wrong.