Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle placeholder and customPlaceholder change #204

Merged
merged 6 commits into from
Apr 16, 2018

Conversation

adrienharnay
Copy link
Contributor

@adrienharnay adrienharnay commented Apr 12, 2018

Fixes #203

@coveralls
Copy link

coveralls commented Apr 12, 2018

Coverage Status

Coverage decreased (-0.03%) to 94.01% when pulling 780c007 on adrienharnay:patch-1 into c8e0e6e on patw0929:master.

@patw0929
Copy link
Owner

There are some eslint errors:

src/components/IntlTelInputApp.js
   166:1   error  Trailing spaces not allowed                                   no-trailing-spaces
   959:27  error  'props' is assigned a value but never used                    no-unused-vars
  1181:20  error  'autoPlaceholder' PropType is defined but prop is never used  react/no-unused-prop-types
  1189:15  error  'numberType' PropType is defined but prop is never used       react/no-unused-prop-types

Could you help to fix it and make sure the test cases have been cover the modification?
Thank you 👍

@adrienharnay
Copy link
Contributor Author

adrienharnay commented Apr 15, 2018

Hey, I fixed the linting and added some tests, but they're not passing yet. Could you please help me a bit on this? I have little experience with React components testing. Thanks 👍


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

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add:

    requests[0].respond(200,
      { 'Content-Type': 'text/javascript' },
      libphonenumberUtils);
    window.eval(getScript().text);

Because the setState in updatePlaceholder will execute only when window.intlTelInputUtils is not undefined.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be good, thanks!

@patw0929 patw0929 merged commit 4d30a63 into patw0929:master Apr 16, 2018
@adrienharnay adrienharnay deleted the patch-1 branch April 16, 2018 13:40
patw0929 added a commit that referenced this pull request Apr 16, 2018
Bug fix:

* #204: Handle placeholder and customPlaceholder change (by @adrienharnay)
andrewsantarin pushed a commit to andrewsantarin/react-intl-tel-input that referenced this pull request Feb 2, 2022
Handle placeholder and customPlaceholder change
andrewsantarin pushed a commit to andrewsantarin/react-intl-tel-input that referenced this pull request Feb 2, 2022
Bug fix:

* patw0929#204: Handle placeholder and customPlaceholder change (by @adrienharnay)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants