Skip to content

Conversation

@kartikktripathi
Copy link
Contributor

Summary

This PR fixes toTitleCase behaviour across both the core utilities and the Planet UI by:
Correctly handling empty string inputs without returning "undefined"
Preserving the existing test expectation of returning undefined for non-string values
Fixing a ReferenceError: toTitleCase is not defined in the Planet interface caused by an empty/missing Planet utility script


Testing

The following validations were run:

  1. Unit test expectation preserved:
expect(toTitleCase(123)).toBeUndefined();
  1. Manual runtime verification:
  • Planet UI loads successfully
  • Tag rendering works without crashing
  • No more toTitleCase is not defined errors
  1. Local server startup:
npm start

Planet now initialises cleanly with correct tag formatting.

@github-actions
Copy link
Contributor

✅ All Jest tests passed! This PR is ready to merge.

@github-actions
Copy link
Contributor

✅ All Jest tests passed! This PR is ready to merge.

@kartikktripathi
Copy link
Contributor Author

Hi @walterbender, just a quick note — a GitHub Actions bot has automatically pushed an additional commit (chore(i18n): auto-update JSON files from updated PO files) onto the base branch, so it may appear in the PR history even though it isn’t part of my changes.

My actual fix is limited to the toTitleCase updates in js/utils/utils.js and planet/js/utils.js. Please let me know if you’d like me to rebase or adjust anything.

Thanks for reviewing in advance!

Copy link
Contributor

@Injora Injora left a comment

Choose a reason for hiding this comment

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

The changes seem relevant, LGTM.

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