-
Notifications
You must be signed in to change notification settings - Fork 0
Specification
The purpose of this exercise is to test your knowledge and ease of use with React. We anticipate this exercise to only take a few hours of your time. We know you have a life outside of getting to know us, but hope this is a little fun for you, too. Either way, thank you for your time and the effort you are putting into interviewing with us!
When you feel confident in your solution please email a link to a code repository (e.g. GitHub or Bitbucket) to Roza.Kawa@rocker.com . For private repositories, please invite rockerrecruit to access your code on GitHub.
Using React and Redux, build a form with the following fields, including validation:
- Social security number
- Phone number
- Email address
- Country
- Submit button
The list of countries can be fetched using a GET-request from https://restcountries.eu/rest/v2/all . You may cache the result set so it only loads the first time the form is displayed.
Restrictions :
- The social security number needs to be a valid Swedish SSN (see
- https://en.wikipedia.org/wiki/Personal_identity_number_(Sweden) )
- The phone number needs to be a valid Swedish phone number (see
- https://en.wikipedia.org/wiki/Telephone_numbers_in_Sweden )
- The email address needs to be valid
- The countries needs to be displayed as a drop down box
- All fields are mandatory
- Validation errors need to be displayed in some way if the input data is wrong.
- The Submit button needs to log "Success" to the console when clicked if, and only if, all fields are valid.
- The input fields need to persist their values upon refresh, e.g. by using local storage, so that their data is still there if the user refreshes the page.
- Local storage needs to be emptied upon a successful Submit so that if the page is refreshed will display empty fields.
- Validation can happen upon input or submit - up to you!