Add Unit Tests for v3 Layer and All GetX Controllers
@srykaran is already working on this.
Since Mar 13, 2026.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Domain
- mobile-dev, testing
Research direction
Start with pubspec.yaml and the existing patterns in test/api_service_test.dart and test/models/json/task_test.dart. Add the listed helpers and tests under test/v3/ and test/modules/controllers/, then run build_runner and the two scoped flutter test commands before the full suite. Done means all 12 v3 tests and 14 controller tests pass, with the specified state, mutation, and edge-case coverage.
Written by the indexing model from the issue text.
Description
Summary
The project has 91+ existing tests covering utilities, JSON models, routes, and tour UI — but the v3 data layer (12 files) and all 14 GetX controllers have zero unit test coverage. These are the most critical parts of the codebase: v3 contains the task database, network sync, and core models, while controllers hold all business logic and state management.
Motivation
- Controllers are the sole owners of business logic per the GetX architecture contract — regressions here break the entire UI silently
- The v3 layer handles live task data sync; bugs here cause data loss
- No test infrastructure exists yet for either layer, making refactors risky
Scope
Phase 1 — Test Infrastructure
- Add
test/v3/helpers.dart— shared setup for sqflite FFI, SharedPreferences mock, binding init - Add
test/modules/controllers/helpers.dart— GetX test mode setup (Get.testMode = true,Get.reset()) - Run
build_runnerto regenerate mocks
Phase 2 — V3 Unit Tests (12 files)
Models (test/v3/models/)
-
test/v3/models/task_test.dart—TaskfromJson/toJson, null fields, edge cases -
test/v3/models/annotation_test.dart—Annotationserialization -
test/v3/models/task_for_replica_test.dart—TaskForReplicamodel
Database (test/v3/db/)
-
test/v3/db/task_database_test.dart— open, CRUD operations (sqflite FFI) -
test/v3/db/update_test.dart— migration/update logic
Network (test/v3/net/)
-
test/v3/net/add_task_test.dart -
test/v3/net/complete_test.dart -
test/v3/net/delete_test.dart -
test/v3/net/fetch_test.dart -
test/v3/net/modify_test.dart -
test/v3/net/origin_test.dart
Champion (test/v3/champion/)
-
test/v3/champion/replica_test.dart— sync logic with mocked DB and origin
Phase 3 — Controller Unit Tests (14 files in test/modules/controllers/)
-
home_controller_test.dart— filterTasks, updateTags, reactive state, search -
splash_controller_test.dart— init flow, navigation state -
taskc_details_controller_test.dart— task init from args, field mutation, save -
settings_controller_test.dart— language change, directory pick, theme -
widget_controller_test.dart -
logs_controller_test.dart -
about_controller_test.dart -
detail_route_controller_test.dart -
manage_task_server_controller_test.dart— server add/remove, connection test -
reports_controller_test.dart -
profile_controller_test.dart -
permission_controller_test.dart -
onboarding_controller_test.dart -
manage_task_champion_creds_controller_test.dart
Acceptance Criteria
-
flutter test test/v3/passes with all 12 v3 tests green -
flutter test test/modules/controllers/passes with all 14 controller tests green -
flutter testfull suite passes without regression - Each controller test covers:
onInitstate, at least 2 state-mutating methods, and error/edge cases
Implementation Notes
- No new pub dependencies needed —
mockitoandsqflite_ffiare already inpubspec.yaml - Reference existing patterns in
test/api_service_test.dart(mock setup) andtest/models/json/task_test.dart(model tests) - All 14 controllers extend
GetxController— useGet.testMode = trueper test group - v3 net tests should mock
http.Clientvia@GenerateMocks([http.Client])
Labels
testing good first issue help wanted v3 controllers
- Dominant language
- Dart
- Stars
- 246
- Forks
- 184
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from CCExtractor/taskwarrior-flutter
-
Fix misaligned text "Select the directory" in settings tileMay be free again @alabeddev claimed this 241 days ago, and no pull request is open. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
CCExtractor/taskwarrior-flutter#639 · 2 comments ·
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Drawer should close automatically when navigating to a new screenMay be free again A pull request for this issue was closed without being merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 52/100
-
Sensitive Credentials Stored in Plain Text Files Without EncryptionMay be free again @sahu-virendra-1908 claimed this 238 days ago, and no pull request is open. Openbug
Difficulty 5/5 Over a week Newbie friendliness 45/100
CCExtractor/taskwarrior-flutter#645 · 1 comment ·
All issues in CCExtractor/taskwarrior-flutter
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 60/100
hiddify/hiddify-app#2668 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
toyota-connected/emb_cli#358 ·
Maintainers usually reply within 1 day
-
area: import beta cluster: callers box improvements severity: minor status: confirmed type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
ibanner56/CallersCompendium#2366 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ccch1mneyyy/dsh-Go#1777 ·
Maintainers usually reply within 1 day
-
area: mobile documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
CommandLineCoding/Elephant#383 ·
Maintainers usually reply within 1 day