[MD] Validate length of title to be no longer than 32 characters#6452
Conversation
2868999 to
1c50e72
Compare
859d2b9 to
6b051f8
Compare
6b051f8 to
8f75470
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6452 +/- ##
===========================================
+ Coverage 49.55% 62.51% +12.95%
===========================================
Files 2670 2976 +306
Lines 54290 58663 +4373
Branches 8878 9553 +675
===========================================
+ Hits 26906 36672 +9766
+ Misses 25720 19891 -5829
- Partials 1664 2100 +436
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
650c8e3 to
043f98c
Compare
| }; | ||
| /* Title validation */ | ||
| if (!title?.trim?.().length) { | ||
| if (!title.trim().length) { |
There was a problem hiding this comment.
Just curious whether title could be undefined. If yes, then calling trim function will throw exception. If no, then there is no concern.
There was a problem hiding this comment.
title will not be undefined, it's initialized with empty string
that's why in the function param, we didn't declare it to be optional param
Signed-off-by: Zhongnan Su <szhongna@amazon.com>
043f98c to
64ea71a
Compare
Description
Add validation for length of title to be no longer than 32 characters in create flow. Otherwise show inline error message, and disable the buttons. This applies to both create flow and edit flow
Issues Resolved
#6433
#6432
Screenshot
iShot_2024-04-14_23.51.32.mp4
Testing the changes
Check List
yarn test:jestyarn test:jest_integration