Skip to content

Commit

Permalink
Try to set up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienharnay authored Apr 15, 2018
1 parent 12bea49 commit 9e96ee8
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions __tests__/TelInput.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,20 @@ describe('TelInput', function () { // eslint-disable-line func-names

expect(subject.find(TelInput).props().placeholder).toBe('Your phone');
});

it('should change input placeholder on customPlaceholder prop change', () => {
const subject = this.makeSubject();

subject.setProps({ customPlaceholder: () => 'Phone number' });
subject.update();

expect(subject.find(TelInput).props().placeholder).toBe('Phone number');

subject.setProps({ customPlaceholder: () => 'Your phone' });
subject.update();

expect(subject.find(TelInput).props().placeholder).toBe('Your phone');
});
});

describe('uncontrolled', () => {
Expand Down

0 comments on commit 9e96ee8

Please sign in to comment.