Skip to content

Commit a0fbad8

Browse files
fix: junit tests
1 parent 37eadb8 commit a0fbad8

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

downloads/src/main/java/org/openedx/downloads/presentation/download/DownloadsViewModel.kt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,7 @@ class DownloadsViewModel(
106106
viewModelScope.launch {
107107
courseNotifier.notifier.collect { notifier ->
108108
when (notifier) {
109-
is CourseStructureGot -> {
110-
fetchDownloads(refresh = true)
111-
}
112-
113-
is CourseStructureUpdated -> {
109+
is CourseStructureGot, is CourseStructureUpdated -> {
114110
fetchDownloads(refresh = true)
115111
}
116112
}

downloads/src/test/java/org/openedx/downloads/DownloadsViewModelTest.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,12 @@ class DownloadsViewModelTest {
8484
private val unknownError = "Unknown error"
8585

8686
private val downloadCoursePreview =
87-
DownloadCoursePreview(id = "course1", name = "", image = "", totalSize = 0)
87+
DownloadCoursePreview(
88+
id = "course1",
89+
name = "",
90+
image = "",
91+
totalSize = DownloadDialogManager.MAX_CELLULAR_SIZE.toLong()
92+
)
8893
private val assignmentProgress = AssignmentProgress(
8994
assignmentType = "Homework",
9095
numPointsEarned = 1f,

0 commit comments

Comments
 (0)