Skip to content

Issue/310 title limit client side#416

Merged
maxachis merged 2 commits intodevfrom
issue/310-title-limit-client-side
Apr 13, 2026
Merged

Issue/310 title limit client side#416
maxachis merged 2 commits intodevfrom
issue/310-title-limit-client-side

Conversation

@maxachis
Copy link
Copy Markdown
Contributor

Summary

  • Adds a maxLength: 255 client-side validator to the title field on the data request
    creation form, so users get immediate feedback instead of a generic API error when
    exceeding the limit
  • Extracts INPUT_NAMES, SELECT_OPTS, and SCHEMA from create.vue into _constants.js for
    testability and reuse
  • Adds unit tests verifying the title field's maxLength and required validators

Closes #310

Test plan

  • Unit tests pass (npm run test:unit) — 32/32 passing
  • Build succeeds (npm run build)
  • Manual: navigate to data request creation form, enter a title longer than 255
    characters, confirm the validation message "Title must be 255 characters or fewer."
    appears before submission

@maxachis maxachis force-pushed the issue/310-title-limit-client-side branch from 542f5f9 to 38a2e3d Compare February 26, 2026 23:20
Copy link
Copy Markdown
Collaborator

@joshuagraber joshuagraber left a comment

Choose a reason for hiding this comment

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

Looks good, but I think e2e is a better strategy for validating this with testing.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't know that a test on constants is useful here. The validator logic is tested in design system, the constant should be its own source of truth. I think we'd get more value from end-to-end test validation if we want to ensure that the error message that shows up in the working system is what we expect.

@maxachis
Copy link
Copy Markdown
Contributor Author

maxachis commented Mar 7, 2026

Looks good, but I think e2e is a better strategy for validating this with testing.

@joshuagraber Excellent point! We do have e2e/data-request/create.spec.js . Do you think that's sufficient as-is?

@joshuagraber
Copy link
Copy Markdown
Collaborator

Do you think that's sufficient as-is?

I think so, @maxachis, but if not, we can certainly add or update those test cases to ensure they're covering everything.

maxachis and others added 2 commits April 5, 2026 05:59
…eation (#310)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Validator logic is already tested in the design system. The constants
file is its own source of truth and doesn't benefit from a unit test
that just re-asserts its values. E2e tests already cover form validation
behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@maxachis maxachis force-pushed the issue/310-title-limit-client-side branch from b98f464 to 3accd99 Compare April 5, 2026 10:15
@maxachis maxachis merged commit 6198de3 into dev Apr 13, 2026
6 checks passed
@maxachis maxachis deleted the issue/310-title-limit-client-side branch April 13, 2026 18:31
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.

2 participants