Skip to content

Commit

Permalink
fix(test): meet coverage thresholds after refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
tay1orjones committed May 8, 2020
1 parent 2bc7520 commit 8c07320
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/components/Header/Header.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ describe('Header testcases', () => {
{
label: 'user',
btnContent: <Avatar fill="white" description="Icon" />,
menuLinkName: 'a menu link name',
childContent: [
{
metaData: {
Expand Down
3 changes: 0 additions & 3 deletions src/components/Header/HeaderAction/HeaderAction.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,5 @@ const HeaderAction = ({ item, index }) => {
};

HeaderAction.propTypes = HeaderActionPropTypes;
HeaderAction.defaultProps = {
item: { onClick: () => {} },
};

export default HeaderAction;
14 changes: 14 additions & 0 deletions src/components/TimePickerSpinner/TimePickerSpinner.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,19 @@ describe('TimePickerSpinner', () => {
expect(screen.getByRole('textbox').value).toEqual('00:00');
});

test('value is not modified on unrelated keystroke', () => {
render(<TimePickerSpinner {...timePickerProps} spinner />);

screen.getByRole('textbox').focus();

fireEvent.keyUp(document.activeElement || document.body, {
key: 'Escape',
code: 'Escape',
keyCode: keyCodes.ESCAPE,
});
expect(screen.getByRole('textbox').value).toEqual('');
});

test('work with strings', () => {
const wrapper = mount(<TimePickerSpinner {...timePickerProps} value="xyz" spinner />);

Expand Down Expand Up @@ -104,6 +117,7 @@ describe('TimePickerSpinner', () => {
upButton.simulate('mouseover');
upButton.simulate('mouseout');
upButton.simulate('blur');
upButton.simulate('mouseout');
expect(
wrapper
.find('.iot--time-picker__wrapper')
Expand Down

0 comments on commit 8c07320

Please sign in to comment.