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

Make stories about validation in form components #4221

Closed
8 of 12 tasks
m0ksem opened this issue Apr 9, 2024 · 0 comments · Fixed by #4224
Closed
8 of 12 tasks

Make stories about validation in form components #4221

m0ksem opened this issue Apr 9, 2024 · 0 comments · Fixed by #4224
Assignees
Labels
BUG Something isn't working d3: medium No cheats. Monsters a bit faster. good first issue Right issue if you're new to vuestic v4: must have This is something really user want to have

Comments

@m0ksem
Copy link
Contributor

m0ksem commented Apr 9, 2024

Components:

  • VaInput
  • VaTextarea
  • VaSelect
  • VaCounter
  • VaDateInput
  • VaTimeInput
  • VaCheckbox
  • VaSwitch

Stories:

  • Validation - make some simple rule, we need to test if error is shown when validation is complete. Test aria attributes like aria-invalid
  • ValidationImmediate - rules executed immediately when component is rendered
    // - [ ] Reset - must set value to clearValue prop and reset validation
    // - [ ] ResetValidation - must hide erorr, make isTouched false and isDirty false
  • ValidtionDirtyState - check if element becomes dirty when value input happens and error message is shown when dirty
  • ValidationTouchedState - check if element becomes touched when element blur happens and error message is shown when touched

! Make sure to test how component displayed, not if useValidation is working - we have unit test for that. We need only check visual (e.g. className, not style), dom content and aria attributes.

Notice, in this task we only need stories, component might be broken and falling test are OK.

Most of stories for one component applies to another, but I'd go with copy/paste stories instead of making some kind of wrapper for it.

Example of VaForm globall stories: packages/ui/src/components/va-form/VaForm.stories.ts - there mostly input tested, so half stories for VaInput is already here. We can copy them with few changes. Keep VaForm stories as is.

@m0ksem m0ksem added BUG Something isn't working good first issue Right issue if you're new to vuestic d3: medium No cheats. Monsters a bit faster. v4: must have This is something really user want to have labels Apr 9, 2024
@m0ksem m0ksem self-assigned this Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG Something isn't working d3: medium No cheats. Monsters a bit faster. good first issue Right issue if you're new to vuestic v4: must have This is something really user want to have
Development

Successfully merging a pull request may close this issue.

1 participant