Skip to content

feat: Add unit tests for various blocs and data sources; update depen…#5

Merged
AdamDybcio merged 1 commit into
masterfrom
tests
Oct 5, 2025
Merged

feat: Add unit tests for various blocs and data sources; update depen…#5
AdamDybcio merged 1 commit into
masterfrom
tests

Conversation

@AdamDybcio

Copy link
Copy Markdown
Owner

This pull request adds a comprehensive suite of unit and widget tests for key business logic components and features in the app, significantly increasing test coverage and reliability. It introduces new tests for various blocs and cubits, covering achievements, browsing, quiz management, user leveling, theming, and remote data source functionality. Additionally, it updates dependencies to support the new tests and removes an obsolete dummy test.

Testing improvements:

  • Added unit tests for AchievementsBloc covering achievement unlocking, state updates, and serialization/deserialization logic.
  • Added unit tests for BrowseBloc to verify quiz filtering and state reset behaviors.
  • Added unit tests for QuizCubit to test quiz loading, error handling, and state transitions.
  • Added unit tests for QuizRunCubit covering timer logic, answering, lifelines, and result calculation.
  • Added unit tests for UserLevelBloc and ThemeCubit covering XP addition, leveling, state reset, and theme serialization/deserialization. [1] [2]
  • Added unit tests for QuizRemoteDataSourceImpl to verify API response handling, error cases, and URI building.

Dependency updates for testing:

  • Added mocktail and fake_async packages to pubspec.yaml to support mocking and time-based testing.

Cleanup:

  • Removed obsolete test/dummy_test.dart file, which contained only a placeholder test.

@AdamDybcio AdamDybcio merged commit daba94f into master Oct 5, 2025
2 checks passed
@AdamDybcio AdamDybcio deleted the tests branch October 5, 2025 21:13
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.

1 participant