Permalink
Browse files

upgrade test coverage

  • Loading branch information...
cassiocardoso authored and gilbarbara committed Oct 6, 2017
1 parent 3563610 commit 186a504a555ff820b7185b300b0696337d3af757
Showing with 11 additions and 2 deletions.
  1. +1 −0 src/index.jsx
  2. +10 −2 test/component.spec.js
View
@@ -106,6 +106,7 @@ class ReactCreditCards extends React.Component {
newCardArray.push(this.hipercard);
}
/* istanbul ignore else */
if (acceptedCards.includes('elo')) {
newCardArray.push(this.elo);
}
View
@@ -330,9 +330,17 @@ describe('Cards', () => {
expect(wrapper.props().acceptedCards).toEqual([]);
wrapper.setProps({
acceptedCards: ['visa', 'mastercard', 'hipercard'],
acceptedCards: ['visa', 'mastercard', 'hipercard', 'elo'],
});
expect(wrapper.props().acceptedCards).toEqual(['visa', 'mastercard', 'hipercard']);
expect(wrapper.props().acceptedCards).toEqual(['visa', 'mastercard', 'hipercard', 'elo']);
});
it('should format a number into string', () => {
wrapper.setProps({
number: 4111111111111111,
});
expect(typeof wrapper.find('.rccs__number').text()).toBe('string');
});
});

0 comments on commit 186a504

Please sign in to comment.