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

feat: implemented calculator form input validation #86

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Taliavivrett
Copy link
Collaborator

Developer: Talia Vivrett

Closes #78

Pull Request Summary

Completed form validation for user inputs to calculator

Modifications

Added to CalculatorForm.tsx

Testing Considerations

Test for error messages when entering incorrect inputs

Pull Request Checklist

  • Code is neat, readable, and works
  • Comments are appropriate
  • The commit messages follows our guidelines
  • The developer name is specified
  • The summary is completed
  • Assign reviewers

Screenshots/Screencast

{put screenshots of your change, or even better a screencast displaying the functionality}

Copy link

vercel bot commented Feb 26, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
surfrider ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 26, 2025 5:35am


const powerPlantOptions = PowerPlantClass.options;
const locationOptions = Location.options;

const currentYear = new Date().getFullYear();

export const CalculateInputSchema = z.object({
Copy link
Collaborator

Choose a reason for hiding this comment

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

This object looks very similar to the CalculateInput object in the schema. Could we add these validation rules to the schema instead? Then we can just reuse the CalculateInput object instead of creating a new one. Also it would be helpful to add some unit tests for these rules

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.

Add form validation for calculator inputs
2 participants