{"id":28762770,"url":"https://github.com/stabldev/hackerrank-react-test-form-validation","last_synced_at":"2025-06-17T08:09:12.922Z","repository":{"id":299330256,"uuid":"965534724","full_name":"stabldev/hackerrank-react-test-form-validation","owner":"stabldev","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-13T11:34:45.000Z","size":177,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-16T01:41:32.920Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stabldev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-13T11:33:26.000Z","updated_at":"2025-04-13T11:34:49.000Z","dependencies_parsed_at":"2025-06-16T01:41:45.746Z","dependency_job_id":"cd694245-678a-47f2-acd6-660f842a3b99","html_url":"https://github.com/stabldev/hackerrank-react-test-form-validation","commit_stats":null,"previous_names":["stabldev/hackerrank-react-test-form-validation"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/stabldev/hackerrank-react-test-form-validation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stabldev%2Fhackerrank-react-test-form-validation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stabldev%2Fhackerrank-react-test-form-validation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stabldev%2Fhackerrank-react-test-form-validation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stabldev%2Fhackerrank-react-test-form-validation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stabldev","download_url":"https://codeload.github.com/stabldev/hackerrank-react-test-form-validation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stabldev%2Fhackerrank-react-test-form-validation/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260318723,"owners_count":22991124,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-17T08:09:11.576Z","updated_at":"2025-06-17T08:09:12.897Z","avatar_url":"https://github.com/stabldev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Product Validation\n\n## Environment \n\n- React Version: 18.2.0\n- Node Version: v18 (LTS)\n- Default Port: 8000\n\n## Application Demo:\n\n![](https://hrcdn.net/s3_pub/istreet-assets/MPf0G1ka7KOzHYWPq_Q81A/product-validation.gif)\n\n## Functionality Requirements\n\nThe component should perform the following validations for a product form:\n\n- The Product name input field should pass the following validations. In case of error, the appropriate message should be shown in `\u003cp data-testid=\"name-input-error\"\u003e\u003c/p\u003e`. This `\u003cp\u003e` tag should be rendered only when field is not valid. Hence, on app load it should not be rendered.\n  - The field is required.\n    - For this error show the message `Product name is required`.\n\n- The Quantity input field should pass following validations. In case of error, the appropriate message should be shown in `\u003cp data-testid=\"quantity-input-error\"\u003e\u003c/p\u003e`. This `\u003cp\u003e` tag should be rendered only when field is not valid. Hence, on app load it should not be rendered.\n  - The field is required.\n    - For this error show the message `Quantity is required`.\n\n- When fields are invalid, the submit button should be disabled. Hence, initially, the button is disabled.\n- Validations are triggered when input fields are touched for the first time.\n- When all fields are valid and touched, the submit button should be enabled.\n- To achieve same interface as shown in demo, when validation fails, add class `error` to inputs. Please note that this is not a requirement and only for CSS purpose. Tests do not test this.\n\n## Testing Requirements\n\nThe following data-testid attributes are required in the component for the tests to pass:\n\n- The product name input: `name-input`\n- The quantity input: `quantity-input`\n- The submit button: `submit-button`\n- The container having the error message for:\n  - the product name input field: `name-input-error`\n  - the quantity input field: `quantity-input-error`\n\n## Project Specifications\n\n**Read Only Files**\n- src/App.test.js\n\n**Commands**\n- run: \n```bash\nnpm start\n```\n- install: \n```bash\nnpm install\n```\n- test: \n```bash\nnpm test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstabldev%2Fhackerrank-react-test-form-validation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstabldev%2Fhackerrank-react-test-form-validation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstabldev%2Fhackerrank-react-test-form-validation/lists"}