A contact form that validate inputs and submit the data to API endpoint.
-
Rename
.env.sample
to.env
, and add a valid API endpoint. -
Install dependencies:
npm i
- Run the development server
npm run serve
- Run tests (optional)
npm run test:unit
- Form should have elements for: name, email, subject, message, and a button to submit.
- Name input should be between 5 and 50 characters, and is required.
- E-mail input should validate an e-mail address, like: [email protected], and is required.
- Subject is optional, and has a limit of 100 characters.
- Message should have the maximum of 500 characters, and is required.
- User should be able to clearly see which input is invalid, and get a message explaining if when it's invalid.
- User can send the message after clicking the button to submit.
- User must see the sending status and the result (error or success).
- If there's any error, user's input should remain in form fields.
- Unit tests should be written for the main component.