Skip to content

Commit

Permalink
Merge pull request #7 from Swiip/add-props-test
Browse files Browse the repository at this point in the history
Add test to ensure direct props to the component shallowed are used
  • Loading branch information
FBerthelot authored Apr 1, 2019
2 parents 6ac76d5 + 043fef5 commit fb37c48
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/component-test-utils-react/src/shallow.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ describe('react shallow render', () => {
expect(cmp.html()).toBe('<button type="button">0</button>');
});

it('it should render component with props', () => {
const Component = ({message}) => {
return <h1>Hello {message}</h1>;
};

const cmp = shallow(<Component message="test world"/>);

expect(cmp.html()).toBe('<h1>Hello test world</h1>');
});

it('it should render Component but should mock ChildComponent', () => {
const ChildComponent = () => {
return <button type="button">0</button>;
Expand Down

0 comments on commit fb37c48

Please sign in to comment.