test (route): add table-driven tests for route IDs with multiple underscores#1039
test (route): add table-driven tests for route IDs with multiple underscores#10393rabiii wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughThis PR adds a new test function ChangesRoute ID Underscore Parsing Test
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|



Description
The current
GET /api/where/route/{id}implementation usesstrings.SplitN(id, "_", 2)to parse the agency and entity IDs. While this correctly handles entity IDs containing underscores, there was no test coverage explicitly validating this edge case, leaving it vulnerable to future regressions.Changes Made:
TestRouteHandler_EntityIDWithUnderscorestoroute_handler_test.go.KCM_40_100479,AGENCY_part1_part2_part3).404 Not Found(since the dummy routes do not exist in the test DB) rather than a400 Bad Request.Fixes: #1010
Summary by CodeRabbit
Bug Fixes
Tests