Skip to content

Inject dependencies for upload and playlist tests - #170

Merged
BisoLab merged 1 commit into
Developmentfrom
track/Unit-Tests
May 3, 2026
Merged

BisoLab merged 1 commit into
Developmentfrom
track/Unit-Tests

Conversation

@Abasy714

@Abasy714 Abasy714 commented May 3, 2026

Copy link
Copy Markdown
Collaborator

Introduce constructor injection and test hooks to make upload and playlist logic testable. UploadTrackRemoteDataSource now accepts a Dio and a multipart-file factory (used instead of direct MultipartFile.fromFile). UploadTrackUseCase accepts fileFactory and fileExists overrides (with sensible defaults) and uses the injected checker instead of calling existsSync directly. UploadFormNotifier methods now accept an optional WidgetRef and allow overriding usecases/data sources/update/delete functions so tests can run without a sealed WidgetRef or real network. Also add a suite of playlist and upload unit tests covering datasource behavior, models, providers, and usecases.

Introduce constructor injection and test hooks to make upload and playlist logic testable. UploadTrackRemoteDataSource now accepts a Dio and a multipart-file factory (used instead of direct MultipartFile.fromFile). UploadTrackUseCase accepts fileFactory and fileExists overrides (with sensible defaults) and uses the injected checker instead of calling existsSync directly. UploadFormNotifier methods now accept an optional WidgetRef and allow overriding usecases/data sources/update/delete functions so tests can run without a sealed WidgetRef or real network. Also add a suite of playlist and upload unit tests covering datasource behavior, models, providers, and usecases.
@Abasy714
Abasy714 requested a review from a team as a code owner May 3, 2026 05:11
@BisoLab
BisoLab merged commit 4e2e25a into Development May 3, 2026
3 checks passed
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.

3 participants