Skip to content

Commit

Permalink
Add tests for formRow.js
Browse files Browse the repository at this point in the history
  • Loading branch information
kyoyadmoon committed Feb 26, 2020
1 parent a16ce83 commit eabd64f
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions packages/form/src/mixins/__tests__/formRow.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,31 @@ it('passes a collected rowProps prop to wrapped component', () => {
});
});


it('passes a custom rowProps prop to wrapped component', () => {
const wrapper = shallow(
<FormRowFoo
desc="foo"
rowProps={{
status: 'success'
}}
status="error"
errorMsg="bar" />
);
const fooProps = wrapper.find(Foo).props();

expect(fooProps).not.toHaveProperty('desc');
expect(fooProps).not.toHaveProperty('status');
expect(fooProps).not.toHaveProperty('errorMsg');

expect(fooProps.rowProps).toMatchObject({
desc: 'foo',
status: 'success',
errorMsg: 'bar',
});
});


it('can optionally keep a ref to wrapped component', () => {
const wrapper = mount(<FormRowBarWithRef />);

Expand Down

0 comments on commit eabd64f

Please sign in to comment.