Skip to content

add unit test coverage for formly-config validation-message formatters #6591

Description

@mengw15

Task Summary

formly-config.ts (frontend/src/app/common/formly/formly-config.ts, codecov ~62%) exports ten pure validation-message formatters used by the Texera formly config, none of which are tested. They are plain functions — no TestBed. Add a spec.

Behavior to add

Each formatter takes (err, field) and returns a message string derived from field.props?.<limit>. For each, pass a sample field (e.g. { props: { minItems: 3 } }) and assert the exact returned string:

  • minItemsValidationMessage / maxItemsValidationMessage
  • minlengthValidationMessage / maxlengthValidationMessage
  • minValidationMessage / maxValidationMessage
  • exclusiveMinimumValidationMessage / exclusiveMaximumValidationMessage
  • multipleOfValidationMessage
  • constValidationMessage

Include a case where the referenced field.props value is absent (the message still renders, with undefined interpolated) so the optional-chaining branch is covered.

Task Type

  • Refactor / Cleanup
  • DevOps / Deployment / CI
  • Testing / QA
  • Documentation
  • Performance
  • Other

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Fields

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions