Skip to content

Conversation

FrederikBolding
Copy link
Member

Improve a couple of error messages when validating UI components that use the children utility method.

@FrederikBolding FrederikBolding requested a review from a team as a code owner September 1, 2025 08:49
@FrederikBolding FrederikBolding changed the title Improve a couple of error messages for UI components fix: Improve a couple of error messages for UI components Sep 1, 2025
@FrederikBolding FrederikBolding marked this pull request as draft September 1, 2025 09:03
@FrederikBolding FrederikBolding marked this pull request as ready for review September 3, 2025 12:36
@FrederikBolding FrederikBolding force-pushed the fb/fix-some-validation-issues branch from bd7e15c to 508d763 Compare September 3, 2025 12:36
Copy link

codecov bot commented Sep 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.28%. Comparing base (a8e0d22) to head (0050cdd).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3625   +/-   ##
=======================================
  Coverage   98.28%   98.28%           
=======================================
  Files         417      417           
  Lines       11793    11803   +10     
  Branches     1841     1844    +3     
=======================================
+ Hits        11591    11601   +10     
  Misses        202      202           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

const result = validate(Text({}), stringUnion);

expect(result[0]?.message).toBe(
'Expected the value to satisfy a union of `string | union`, but received: [object Object]',
Copy link
Member

Choose a reason for hiding this comment

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

What was this message before? This doesn't seem ideal either 😅

Copy link
Member Author

Choose a reason for hiding this comment

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

This is mostly for coverage purposes, not to actually test the error messages. We want to ensure that typedUnion doesn't do something unexpected when *entries is called with a string for example

Copy link
Member Author

Choose a reason for hiding this comment

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

E.g.

if (
!isObject(value) ||
!hasProperty(value, 'type') ||
typeof value.type !== 'string'
) {
return;
}

@FrederikBolding FrederikBolding added this pull request to the merge queue Sep 3, 2025
Merged via the queue into main with commit 2c8d5bb Sep 3, 2025
120 checks passed
@FrederikBolding FrederikBolding deleted the fb/fix-some-validation-issues branch September 3, 2025 13:04
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