-
Notifications
You must be signed in to change notification settings - Fork 78
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
7 changed files
with
272 additions
and
178 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import InputGroupAddon from './_InputGroupAddon'; | ||
import { mount } from 'enzyme'; | ||
import React from 'react'; | ||
import renderer from 'react-test-renderer'; | ||
|
||
|
||
describe('<InputGroupAddon />', () => { | ||
const inputGroupAddon = ( | ||
<InputGroupAddon addon='$' /> | ||
); | ||
|
||
test('create list group item actions', () => { | ||
let component = renderer.create(inputGroupAddon); | ||
let tree = component.toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
|
||
describe('Prop spreading', () => { | ||
test('should allow props to be spread to the ListGroupItemActions component', () => { | ||
const element = mount(<InputGroupAddon data-sample='Sample' />); | ||
|
||
expect( | ||
element.getDOMNode().attributes['data-sample'].value | ||
).toBe('Sample'); | ||
}); | ||
}); | ||
|
||
test('should allow props to be spread to the InputGroup component for type number\'s up button element', () => { | ||
const element = mount(<InputGroupAddon inputType='number' numberUpButtonProps={{ 'data-sample': 'Sample' }} />); | ||
|
||
expect( | ||
element.find('button.sap-icon--slim-arrow-up').getDOMNode().attributes['data-sample'].value | ||
).toBe('Sample'); | ||
}); | ||
|
||
test('should allow props to be spread to the InputGroup component for type number\'s down button element', () => { | ||
const element = mount(<InputGroupAddon inputType='number' numberDownButtonProps={{ 'data-sample': 'Sample' }} />); | ||
|
||
expect( | ||
element.find('button.sap-icon--slim-arrow-down').getDOMNode().attributes['data-sample'].value | ||
).toBe('Sample'); | ||
}); | ||
}); |
Oops, something went wrong.