Skip to content

FOUR-32296: Reject whitespace-only values in required fields#1921

Open
eiresendez wants to merge 1 commit into
developfrom
bugfix/FOUR-32296
Open

FOUR-32296: Reject whitespace-only values in required fields#1921
eiresendez wants to merge 1 commit into
developfrom
bugfix/FOUR-32296

Conversation

@eiresendez

@eiresendez eiresendez commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Issue & Reproduction Steps

Configure a Line Input or Text Area with the Required validation rule, open the screen Preview, enter only spaces, and submit the form.

Expected behavior: Whitespace-only values should be treated as empty, display the "Field is required" validation error, and block submission. Values containing visible text with surrounding whitespace should remain valid and unchanged.

Actual behavior: Whitespace-only values satisfy the Required validation rule and allow the form to be submitted without meaningful content.

Solution

  • Added a shared required-value check that rejects whitespace-only strings across required, required_if, and required_unless.
  • Preserved existing behavior for arrays, booleans, numeric zero, and values containing visible text.
  • Added unit and Cypress coverage for Line Input, Text Area, Submit, and conditional required rules.

How to Test

Test the steps above.

Automated checks completed:

  • npx jest tests/unit/ValidationRules.spec.js --runInBand
  • npm run run-cypress -- --spec "tests/e2e/specs/RequiredWhitespace.spec.js,tests/e2e/specs/ValidationRules.spec.js"
  • npm run build

Note: The repository-wide Jest run is currently blocked by unrelated Vue and validatorjs transformation errors; the new focused unit suite passes.

Related Tickets & Packages

ci:deploy

.

@eiresendez eiresendez self-assigned this Jul 20, 2026
@cypress

cypress Bot commented Jul 20, 2026

Copy link
Copy Markdown

screen-builder    Run #2306

Run Properties:  status check passed Passed #2306  •  git commit 9f2798feec: FOUR-32296: Reject whitespace-only values in required fields
Project screen-builder
Branch Review bugfix/FOUR-32296
Run status status check passed Passed #2306
Run duration 09m 46s
Commit git commit 9f2798feec: FOUR-32296: Reject whitespace-only values in required fields
Committer Eleazar Resendez
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 19
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 390
View all changes introduced in this branch ↗︎

@vladyrichter

Copy link
Copy Markdown

QA server K8S was successfully deployed https://ci-1275e14c54.engk8s.processmaker.net

@eiresendez
eiresendez requested a review from mcraeteisha July 21, 2026 22:28
@processmaker-sonarqube

Copy link
Copy Markdown

@vladyrichter

Copy link
Copy Markdown

QA server K8S was successfully deployed https://ci-1275e14c54.engk8s.processmaker.net

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.

3 participants