Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@connoratrug
Copy link
Contributor

Fix issue where required boolean field with a value of false were counted as not being filled in

What are the main changes you did

  • when checking if a required field has a value set, if the field type is of type boolean either value true or false are counted as set ( i.e. although false is falsy the value has still been set

How to test

  • go to form with required boolean field ( or create one by setting a bool field to required ), fill out the field testing true, false en no value. setting the value to false should remove the field form the empty required field count ( so should setting the value to true, clearing the value should include the field in the empty required fields count )

Checklist

  • updated docs in case of new feature
  • added/updated tests
  • added/updated testplan to include a test for this fix, including ref to bug using # notation

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 8, 2025

Copy link
Contributor

@chinook25 chinook25 left a comment

Choose a reason for hiding this comment

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

works!

const formValues = ref<Record<string, columnValue>>({});
const formValues = ref<Record<string, columnValue>>({
// non empty required bool field
col6: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

could have used a meaningful id instead of repeating this comments

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yea this reuses the setup for all the tests , maybe we should organize using describe or multiple test. not sure it's a bit of a trade off between reuses and specific test setup. might also be a bit of a code smell that we are doing to much in a single module

@connoratrug connoratrug merged commit d48b0bd into master Dec 10, 2025
7 checks passed
@connoratrug connoratrug deleted the fix/tw-forms-required-bool-field-validation branch December 10, 2025 09:12
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