Skip to content

Commit

Permalink
Fix daily challenge test function
Browse files Browse the repository at this point in the history
  • Loading branch information
joaomanaia committed Sep 30, 2024
1 parent c4d3b5d commit 62029c2
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,21 @@ internal class DailyChallengeRepositoryImplTest {
assertThat(resultTasks).containsExactlyElementsIn(tasks)

coVerify(exactly = 1) { comparisonQuizRepository.getCategories() }
confirmVerified()
}

@Test
fun `getAvailableTasksFlow returns available tasks`() = runTest {
val tasks = FakeData.generateTasks()
val expiredTasks = FakeData.generateTasks(
count = 5,
dayDuration = (-1).days..0.days
dayDuration = (-2).days..(-1).days
)
val allTasks = tasks + expiredTasks
val newTasks = FakeData.generateTasks(
count = 5,
dayDuration = (1).days..10.days
)
val allTasks = tasks + expiredTasks + newTasks

dailyChallengeRepository.getAvailableTasksFlow().test {
dailyChallengeDao.insertAll(allTasks.map(DailyChallengeTask::toEntity))
Expand Down

0 comments on commit 62029c2

Please sign in to comment.