Conversation
Updates Dart test template to use the first enum value for string properties with enums when generating test data, instead of always using the example value. This ensures generated test data is valid for properties with restricted enum values.
📝 WalkthroughWalkthroughA template file for generating Dart service tests has been updated to handle response model types conditionally. When multiple response models exist, the generated test expects a Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (3 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 |
Updated the Dart service test template to check for Map<String, dynamic> when multiple response models are present, improving test accuracy for methods with multiple possible response types.
Previously, the examples for the messaging service were invalid, but now everything is fine, I have restored the logic.



What does this PR do?
This ensures that generated tests use valid enum values for properties with enums, preventing runtime errors during test execution.
Test Plan
regenerate sdk and run dart test
also push changes and ensure the GitHub Actions workflow for Dart SDK completes successfully with all tests passing. #1247
before:



after:
Have you read the Contributing Guidelines on issues?
Yes
Summary by CodeRabbit