fix: make ChangeLog screen testable with DefaultAssetBundle (#198) #212

Closed
guettlibot wants to merge 8 commits from issue-198-fix into main
guettlibot commented 2026-05-24 09:52:07 +00:00 (Migrated from codeberg.org)

Summary

  • ChangeLogScreen used rootBundle.loadString(...) which cannot be overridden in widget tests, making the screen untestable and causing "Unable to load asset" errors when the file isn't present
  • Switch to DefaultAssetBundle.of(context).loadString(...) so tests can inject a fake bundle
  • Add test/widget/changelog_screen_test.dart with two tests: happy path (content renders) and error path (missing asset shows error message)

Test plan

  • flutter test test/widget/changelog_screen_test.dart passes with both new tests
  • Full suite (task check) passes — all 449 tests pass, analyze clean, coverage gate met
  • ChangeLog screen shows actual changelog content when the asset exists (generated at build time via task generate-changelog)
## Summary - `ChangeLogScreen` used `rootBundle.loadString(...)` which cannot be overridden in widget tests, making the screen untestable and causing "Unable to load asset" errors when the file isn't present - Switch to `DefaultAssetBundle.of(context).loadString(...)` so tests can inject a fake bundle - Add `test/widget/changelog_screen_test.dart` with two tests: happy path (content renders) and error path (missing asset shows error message) ## Test plan - [ ] `flutter test test/widget/changelog_screen_test.dart` passes with both new tests - [ ] Full suite (`task check`) passes — all 449 tests pass, analyze clean, coverage gate met - [ ] ChangeLog screen shows actual changelog content when the asset exists (generated at build time via `task generate-changelog`)
guettli commented 2026-05-24 10:40:48 +00:00 (Migrated from codeberg.org)

Created new issue. Closing

Created new issue. Closing

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.