Skip to content

Improve test coverage with unit and integration tests - #185

Merged
richardthe3rd merged 2 commits into
mainfrom
claude/improve-test-coverage-YfcKy
Dec 23, 2025
Merged

Improve test coverage with unit and integration tests#185
richardthe3rd merged 2 commits into
mainfrom
claude/improve-test-coverage-YfcKy

Conversation

@richardthe3rd

Copy link
Copy Markdown
Owner

This pull request introduces comprehensive new widget and unit tests to improve the reliability and coverage of the codebase, particularly around routing, URL launching, and category color helpers. Additionally, the minimum code coverage threshold in the CI workflow has been significantly increased to ensure higher code quality.

Testing improvements:

  • Added a full suite of widget and unit tests for the appRouter configuration, verifying navigation, route parsing, and path matching for all main routes and dynamic parameters in test/router_test.dart.
  • Added extensive widget tests for the UrlLauncherHelper utility, including successful launches, error handling, custom error messages, and exception scenarios, with a mock implementation of the UrlLauncherPlatform in test/url_launcher_helper_test.dart.
  • Expanded widget tests for CategoryColorHelper.getCategoryColor to cover all supported categories and both light and dark themes, ensuring correct color assignment in test/utils_test.dart.

CI/CD and code quality:

  • Increased the minimum code coverage threshold in .github/workflows/build-deploy.yml from 25% to 70%, reflecting improved test coverage and enforcing higher standards for future changes.

Improvements:
- Enhanced CategoryColorHelper tests for all beverage types and themes
- Added UrlLauncherHelper tests for URL launching behavior
- Added router tests for navigation paths and URL encoding
- Fixed router tests to use proper types (DrinkSort enum)

Test count: 405 tests passing
Coverage improved across utility helpers and router configuration

Testing approach:
- Tests focus on behavior, not implementation details
- Proper mocking of platform interfaces (URL launcher)
- URI encoding/decoding edge cases covered
- Both light and dark theme variants tested
Now that test coverage has been significantly improved (72%+),
we can enforce a higher coverage threshold in CI to prevent
regressions.

Changes:
- minimum-coverage: 25 → 70
- Updated comment to reflect current coverage level
- TODO completed: threshold restored to original target
@richardthe3rd
richardthe3rd force-pushed the claude/improve-test-coverage-YfcKy branch from fc648bc to 73627d9 Compare December 23, 2025 16:51
@github-actions

Copy link
Copy Markdown
Contributor

LCOV of commit 73627d9 during Flutter App CI/CD #948

Summary coverage rate:
  lines......: 75.8% (1978 of 2609 lines)
  functions..: no data found
  branches...: no data found

Files changed coverage rate: n/a

@codecov

codecov Bot commented Dec 23, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Cloudflare Pages Preview

Your preview deployment is ready!

Preview URL: https://claude-improve-test-coverage.staging-cambeerfestival.pages.dev

This preview will be automatically updated when you push new commits to this PR.

@richardthe3rd
richardthe3rd merged commit 0c033c8 into main Dec 23, 2025
10 checks passed
@richardthe3rd
richardthe3rd deleted the claude/improve-test-coverage-YfcKy branch December 23, 2025 17:06
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