Skip to content

Commit

Permalink
Fixing test
Browse files Browse the repository at this point in the history
  • Loading branch information
savvasdalkitsis committed Jan 12, 2025
1 parent 7aba973 commit 67b38ca
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ limitations under the License.
*/
package com.savvasdalkitsis.uhuruphotos.feature.feed.domain.implementation.usecase

import androidx.work.WorkInfo
import com.savvasdalkitsis.uhuruphotos.feature.upload.domain.api.model.UploadJob
import com.savvasdalkitsis.uhuruphotos.feature.upload.domain.api.model.UploadJobState
import com.savvasdalkitsis.uhuruphotos.feature.upload.domain.api.model.UploadStatus
import com.savvasdalkitsis.uhuruphotos.feature.uploads.domain.api.model.Uploads
import com.savvasdalkitsis.uhuruphotos.feature.uploads.domain.api.usecase.UploadsUseCase
Expand All @@ -34,13 +32,13 @@ fun UploadsUseCase.hasNoUploadsInProgress() {
}

fun UploadsUseCase.hasUploadsInProgress(vararg ids: Long) {
every { observeUploadsInFlight() }.returns(flowOf(Uploads(ids.map { UploadJob(it, null, "", UploadJobState(WorkInfo.State.RUNNING, 0f), UploadStatus.InQueue) })))
every { observeUploadsInFlight() }.returns(flowOf(Uploads(ids.map { UploadJob(it, null, "", UploadStatus.InQueue) })))
}

fun UploadsUseCase.hasNoProcessingInProgress() {
hasProcessingInProgress()
}

fun UploadsUseCase.hasProcessingInProgress(vararg ids: Long) {
every { observeUploadsInFlight() }.returns(flowOf(Uploads(ids.map { UploadJob(it, null, "", UploadJobState(WorkInfo.State.RUNNING, 0f), UploadStatus.Processing) })))
every { observeUploadsInFlight() }.returns(flowOf(Uploads(ids.map { UploadJob(it, null, "", UploadStatus.Processing) })))
}

0 comments on commit 67b38ca

Please sign in to comment.