Skip to content

Commit

Permalink
[pattern] update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hshoff committed Apr 5, 2019
1 parent 3150250 commit b6ed2b1
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions packages/vx-pattern/test/Pattern.test.js
Expand Up @@ -16,9 +16,7 @@ describe('<Pattern />', () => {
</Pattern>
);
expect(console.error).toBeCalled();
expect(console.error.mock.calls[0][0]).toEqual(
'Warning: Failed prop type: The prop `id` is marked as required in `W`, but its value is `undefined`.\n in W'
);
expect(console.error.mock.calls[0][0].startsWith('Warning: Failed prop type:')).toEqual(true);
});

test('it should require a width prop', () => {
Expand All @@ -28,9 +26,7 @@ describe('<Pattern />', () => {
</Pattern>
);
expect(console.error).toBeCalled();
expect(console.error.mock.calls[0][0]).toEqual(
'Warning: Failed prop type: The prop `width` is marked as required in `W`, but its value is `undefined`.\n in W'
);
expect(console.error.mock.calls[0][0].startsWith('Warning: Failed prop type:')).toEqual(true);
});

test('it should require a height prop', () => {
Expand All @@ -40,16 +36,12 @@ describe('<Pattern />', () => {
</Pattern>
);
expect(console.error).toBeCalled();
expect(console.error.mock.calls[0][0]).toEqual(
'Warning: Failed prop type: The prop `height` is marked as required in `W`, but its value is `undefined`.\n in W'
);
expect(console.error.mock.calls[0][0].startsWith('Warning: Failed prop type:')).toEqual(true);
});

test('it should require children', () => {
const wrapper = mount(<Pattern id="test" width={4} />);
expect(console.error).toBeCalled();
expect(console.error.mock.calls[0][0]).toEqual(
'Warning: Failed prop type: The prop `children` is marked as required in `W`, but its value is `undefined`.\n in W'
);
expect(console.error.mock.calls[0][0].startsWith('Warning: Failed prop type:')).toEqual(true);
});
});

0 comments on commit b6ed2b1

Please sign in to comment.